Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

If using __class__ and __dict__ attribuites is a feature, it does not work for 
__getattr__(). I think it is confusing if __dir__() and __getattr__() are not 
consistent. I'll try to deal with unittes.mock and then will look how this will 
work with other classes that override __class__ or __dict__. Also we need to 
check all classes with custom __getattr__ for the matter of custom __dir__.

I think that it might be better if dir() for instance excluded names which are 
not accessed as via instance, e.g. non-descriptor class attributes and class 
methods. But it may be not easy to do.

----------

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

Reply via email to