Error in previous post - Import behaviour

Andrew James drew at gremlinhosting.com
Sat Dec 4 10:16:16 EST 2004


All,
The example given in the previous e-mail I sent was wrong (and makes the
question look stupid). In the attribute instantiation example, the
__main__ declaration should read:

> if __name__ == 'main':
> 	y = myY()

I meant it to show that even if I never instantiate X, its attributes
still get created.

Regards,
Andrew




More information about the Python-list mailing list