Dave Baum <[EMAIL PROTECTED]> wrote:

> In article <[EMAIL PROTECTED]>,
>  johnny <[EMAIL PROTECTED]> wrote:
> 
>> scope of "def main()" interms of class A?
>> 
>> myModule:
>> 
>> class A:
>>    main()
>> 
>> def main():
>> 
> 
> Yes, class A can access main.  The name "main" will be defined at the 
> top level of the module, and is considered a global for that module.

No, the name "main" will be defined when the execution of the 'def main()' 
statement is complete. It is not defined until that point.

In the example given the class statement is executed before the def 
statement is executed so at that point main is still undefined.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to