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

Method get_attr

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

Internal get_attr implementation for fast lookup on a class. Searches the full MRO (including self) with method cache acceleration.

(&self, attr_name: &'static PyStrInterned)

Source from the content-addressed store, hash-verified

895 /// Internal get_attr implementation for fast lookup on a class.
896 /// Searches the full MRO (including self) with method cache acceleration.
897 pub fn get_attr(&self, attr_name: &'static PyStrInterned) -> Option<PyObjectRef> {
898 self.find_name_in_mro(attr_name)
899 }
900
901 /// Cache __init__ for CALL_ALLOC_AND_ENTER_INIT specialization.
902 /// The cache is valid only when guarded by the type version check.

Callers 15

mainFunction · 0.45
runFunction · 0.45
run_shellFunction · 0.45
run_fileFunction · 0.45
get_importerFunction · 0.45
py_mainFunction · 0.45
mainFunction · 0.45
module_execFunction · 0.45
get_fd_from_file_optFunction · 0.45
get_future_repr_infoFunction · 0.45

Calls 1

find_name_in_mroMethod · 0.80

Tested by 2

test_mode_via_statMethod · 0.36
frozen_origname_matchesFunction · 0.36