MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / getmembers_static

Function getmembers_static

tools/python-3.11.9-amd64/Lib/inspect.py:597–609  ·  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

(object, predicate=None)

Source from the content-addressed store, hash-verified

595 return _getmembers(object, predicate, getattr)
596
597def 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
611Attribute = namedtuple('Attribute', 'name kind defining_class object')
612

Callers

nothing calls this directly

Calls 1

_getmembersFunction · 0.85

Tested by

no test coverage detected