import's recursion

Carl Banks imbosol at vt.edu
Fri Dec 6 01:18:16 EST 2002


Erik Max Francis wrote:
> _rui_ wrote:
> 
>> hi, list!
>>
>> Tell me please, why recursion is absent?
> 
> What would you expect it to meaningfully do?  Recurse until it hits a
> recursion limit RuntimeError?


Maybe he does.  Perhaps he expects to terminate the recursion by
putting the import inside some sort of if statement.

Probably he just wants to access the module's global namespace.  The
best way to do that is with globals().


-- 
CARL BANKS



More information about the Python-list mailing list