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

Method has_attr

crates/vm/src/builtins/type.rs:1098–1100  ·  view source on GitHub ↗

Fast lookup for attribute existence on a class.

(&self, attr_name: &'static PyStrInterned)

Source from the content-addressed store, hash-verified

1096
1097 /// Fast lookup for attribute existence on a class.
1098 pub fn has_attr(&self, attr_name: &'static PyStrInterned) -> bool {
1099 self.has_name_in_mro(attr_name)
1100 }
1101
1102 /// Check if attribute exists in MRO, using method cache for fast check.
1103 /// Unlike find_name_in_mro, avoids cloning the value on cache hit.

Callers 11

ceilFunction · 0.45
floorFunction · 0.45
cformat_bytesFunction · 0.45
cformat_stringFunction · 0.45
execute_instructionMethod · 0.45
getattro_wrapperFunction · 0.45
try_from_objectMethod · 0.45
concatFunction · 0.45
iconcatFunction · 0.45
anextFunction · 0.45
slot_newMethod · 0.45

Calls 1

has_name_in_mroMethod · 0.80

Tested by

no test coverage detected