Re: a dummy python question

2005-08-26 Thread infidel
If that were so, Pythonistas could never write a recursive function! No, presumably at the writing of the edition of _Learning Python_ that he is reading, Python did not have nested scopes in the language, yet. One could always write a recursive function provided it was at the top-level of

a dummy python question

2005-08-25 Thread Learning Python
A example in learning Python by Mark Lutz and David Ascher about function scope example like this: def outer(x): def inner(i): print i, if i: inner(i-1) inner(x) outer(3) Here supposely, it should report error, because the function inner cannot see itself since inner

Re: a dummy python question

2005-08-25 Thread infidel
Learning Python wrote: A example in learning Python by Mark Lutz and David Ascher about function scope example like this: def outer(x): def inner(i): print i, if i: inner(i-1) inner(x) outer(3) Here supposely, it should report error, because the function

Re: a dummy python question

2005-08-25 Thread [EMAIL PROTECTED]
This is not reproducible under either Python 2.3.4 (UNIX), Python 2.4.1 (UNIX) or Python 2.4.1 (Windows). If you still need help, we need to know precisely what you're doing. = scope_test.py = #!/usr/bin/env python # # (insert his code, verbatim...) # if __name__=='__main__':

Re: a dummy python question

2005-08-25 Thread rafi
Learning Python wrote: def outer(x): def inner(i): print i, if i: inner(i-1) inner(x) outer(3) Here supposely, it should report error, because the function inner cannot see itself since inner is only in local namespace of outer. There is no error. the

Re: a dummy python question

2005-08-25 Thread Robert Kern
infidel wrote: Learning Python wrote: A example in learning Python by Mark Lutz and David Ascher about function scope example like this: def outer(x): def inner(i): print i, if i: inner(i-1) inner(x) outer(3) Here supposely, it should report error, because the

Re: a dummy python question

2005-08-25 Thread Learning Python
Thanks all for replying. I finally know what's going on. -- http://mail.python.org/mailman/listinfo/python-list