Terry Reedy wrote: > Bryan wrote: > >> How come dir(Foo) does not show __name__? That is how I was >> investigating the possibilities. > > Interesting question. Seems like an oversight. dir(some_module) and > dir(some_function) include '__name__'. I suggest you search the tracker > for existing issues on this subject and add a feature request if there > is none.
The __name__ attribute of types and classes is actually a descriptor of the metaclass. It doesn't show up just like __bases__ and a few others. However for modules __name__ is just an ordinary attribute that gets set by the module class. Christian -- http://mail.python.org/mailman/listinfo/python-list