embarrassing class question

G

Gregory Ewing

Paul said:
I'm not sure that's necessarily a good idea... when you're trying to figure
out why something behaves in a certain way you want to check for the
presence of methods with special names.

If you need to find out what's really there, you can always
look at module.__dict__.keys().

(BTW, there are no function names that have a special meaning
in a module dict -- a module is not like a class.)
 
S

Steven D'Aprano

(BTW, there are no function names that have a special meaning in a
module dict -- a module is not like a class.)

Pity... it would be nice to have a __main__() function, or perhaps
main(), that was automatically called when you call the module like a
script.

There are, however, a few special module attributes -- they just aren't
functions. __doc__, __name__, __file__ and __package__ come to mind.
 

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

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top