MCPcopy Index your code
hub / github.com/python/cpython / getmembers_static

Function getmembers_static

Lib/inspect.py:525–537  ·  view source on GitHub ↗

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 all m

(object, predicate=None)

Source from the content-addressed store, hash-verified

523 return _getmembers(object, predicate, getattr)
524
525def getmembers_static(object, predicate=None):
526 """Return all members of an object as (name, value) pairs sorted by name
527 without triggering dynamic lookup via the descriptor protocol,
528 __getattr__ or __getattribute__. Optionally, only return members that
529 satisfy a given predicate.
530
531 Note: this function may not be able to retrieve all members
532 that getmembers can fetch (like dynamically created attributes)
533 and may find members that getmembers can't (like descriptors
534 that raise AttributeError). It can also return descriptor objects
535 instead of instance members in some cases.
536 """
537 return _getmembers(object, predicate, getattr_static)
538
539Attribute = namedtuple('Attribute', 'name kind defining_class object')
540

Callers

nothing calls this directly

Calls 1

_getmembersFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…