please help explain this result

Yingjie Lan lanyjie at yahoo.com
Sun Oct 17 08:00:59 EDT 2010


> From: Nobody <nobody at nowhere.com>

> The determination of local or global is made when the "def"
> statement is
> executed, not when the function is called.

Thanks a lot for your reply, which is of great help!

So, I assume that when the 'def' is executed, any 
name occurred will be categorized as either local 
or global (maybe nonlocal?).

Yingjie


      



More information about the Python-list mailing list