[issue45288] Inspect - Added sort_result parameter on getmembers function.

Serhiy Storchaka report at bugs.python.org
Mon Sep 27 07:45:15 EDT 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It depends on what you want to get. In general, it is difficult if interpret your request literally. For example, if you define class A in module a, class B in module b, and class C which inherits from classes A and B in module c, then what members of C are defined first: inherited from A or inherited from B? Oh, and some members can be defined in a metaclass of A, B or C. And what order of members inherited from the object class or other builtin classes? And what to do with members excluded from __dir__()? And dynamic members provided by __getattr__() or __getattribute__()? You need to specify in more detail what you want to get a meaningful answer. It may be that you actually do not need all these details and can just look in type's dicts in the mro order.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45288>
_______________________________________


More information about the Python-bugs-list mailing list