a dummy python question

infidel saint.infidel at gmail.com
Fri Aug 26 10:18:14 EDT 2005


> > 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 the module. One could not write a recursive function inside
> another function because inside inner(), it could only access two
> namespaces, the one local to inner() and the module's namespace, not the
> namespace of outer() where inner() is defined.

Ah, that makes sense.  Thanks for the clarification.




More information about the Python-list mailing list