Subclasses in Python

Greg Ewing greg at cosc.canterbury.ac.nz
Thu Apr 29 22:27:35 EDT 2004


Thomas Philips wrote:
> Perfect! But tell me, how did you know to use __name__? I typed
> dir(object) and dir(Player) in IDLE, and in neither case did __name__
> show up.

Probably it's an oversight on the part of whoever implemented
the dir() method for classes. I guess you just have to find
out things like that by hanging out in c.l.py.:-)

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list