Error in previous post - Import behaviour

A

Andrew James

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,212
Messages
2,571,101
Members
47,697
Latest member
looped_monk

Latest Threads

Top