Georg Brandl added the comment:

"Attributes from the metaclass have always been excluded from the dir() of a 
class."

Be that as it may, I think it is wrong.  I can understand excluding methods of 
the metaclass, but __qualname__ (and friends) are only defined in the metaclass 
because they are properties and not __dict__ members, but they are regular 
attributes of the class, not of the metaclass.

E.g. why is __module__ in there and not __qualname__? Both are determined 
dynamically at class creation time.

The answer is that it's an implementation detail: there is no tp_module (or 
ht_module) member in the PyHeapTypeObject struct to store it, so it's stored in 
__dict__, while __qualname__ is stored in a struct member.

----------
nosy: +pitrou

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22790>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to