MCPcopy Index your code
hub / github.com/RustPython/RustPython / attr_is_not_inherited

Function attr_is_not_inherited

scripts/whats_left.py:104–109  ·  view source on GitHub ↗

returns True if type_'s attr is not inherited from any of its base classes

(type_, attr)

Source from the content-addressed store, hash-verified

102
103
104def attr_is_not_inherited(type_, attr):
105 """
106 returns True if type_'s attr is not inherited from any of its base classes
107 """
108 bases = type_.__mro__[1:]
109 return getattr(type_, attr) not in (getattr(base, attr, None) for base in bases)
110
111
112def extra_info(obj):

Callers 2

gen_methodsFunction · 0.85

Calls 1

getattrFunction · 0.85

Tested by

no test coverage detected