Return all members of an object as (name, value) pairs sorted by name without triggering dynamic lookup via the descriptor protocol, __getattr__ or __getattribute__. Optionally, only return members that satisfy a given predicate. Note: this function may not be able to retrieve
(object, predicate=None)
| 595 | return _getmembers(object, predicate, getattr) |
| 596 | |
| 597 | def getmembers_static(object, predicate=None): |
| 598 | """Return all members of an object as (name, value) pairs sorted by name |
| 599 | without triggering dynamic lookup via the descriptor protocol, |
| 600 | __getattr__ or __getattribute__. Optionally, only return members that |
| 601 | satisfy a given predicate. |
| 602 | |
| 603 | Note: this function may not be able to retrieve all members |
| 604 | that getmembers can fetch (like dynamically created attributes) |
| 605 | and may find members that getmembers can't (like descriptors |
| 606 | that raise AttributeError). It can also return descriptor objects |
| 607 | instead of instance members in some cases. |
| 608 | """ |
| 609 | return _getmembers(object, predicate, getattr_static) |
| 610 | |
| 611 | Attribute = namedtuple('Attribute', 'name kind defining_class object') |
| 612 |
nothing calls this directly
no test coverage detected