Steven D'Aprano added the comment: Thank you for the extensive examples, but I'm afraid this is not a bug.
In your code, "result" is a local variable, which means it only exists inside the fib() function. When you try inspecting "result", it fails because there is no global variable "result". Try doing this instead: result = fib(100) result result[3] and it should work as you expect. (By the way, it doesn't matter if the local variable inside the fib() function and the global variable are different names or the same, in both cases they are considered different.) ---------- nosy: +steven.daprano resolution: -> not a bug _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22202> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com