Author davidhalter
Recipients davidhalter
Date 2013-09-11.06:20:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I recently stumbled over the ``dir`` function not working correctly with classes. This means that ``dir(object)`` won't list ``object.__bases__`` or ``object.__subclasses`` (and many other useful methods).

I think that we should change that. The C function ``type_dir`` (in ``Objects/typeobject.c``) has a documentation entry which states:

"We deliberately don't suck up its __class__, as methods belonging to the metaclass would probably be more confusing than helpful."

I think that that's not true. The current behaviour of ``dir`` is way more confusing, since ``dir`` is typically the tool how we find out about magic methods.

I wrote about it in more details here:
Date User Action Args
2013-09-11 06:20:51davidhaltersetrecipients: + davidhalter
2013-09-11 06:20:51davidhaltersetmessageid: <>
2013-09-11 06:20:51davidhalterlinkissue19002 messages
2013-09-11 06:20:50davidhaltercreate