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

Method fast_issubclass

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

Determines if `subclass` is actually a subclass of `cls`, this doesn't call __subclasscheck__, so only use this if `cls` is known to have not overridden the base __subclasscheck__ magic method.

(&self, cls: &impl Borrow<PyObject>)

Source from the content-addressed store, hash-verified

1254 /// so only use this if `cls` is known to have not overridden the base __subclasscheck__ magic
1255 /// method.
1256 pub fn fast_issubclass(&self, cls: &impl Borrow<PyObject>) -> bool {
1257 self.as_object().is(cls.borrow()) || self.mro.read()[1..].iter().any(|c| c.is(cls.borrow()))
1258 }
1259
1260 pub fn mro_map_collect<F, R>(&self, f: F) -> Vec<R>
1261 where

Callers 15

throwMethod · 0.80
check_array_typeFunction · 0.80
cursorMethod · 0.80
write_exception_innerMethod · 0.80
try_from_objectMethod · 0.80
offer_suggestionsFunction · 0.80
is_stdlib_module_nameFunction · 0.80
gen_throwMethod · 0.80
slot_newMethod · 0.80
get_condition_matcherFunction · 0.80
_cmp_innerMethod · 0.80
get_itemMethod · 0.80

Calls 5

isMethod · 0.80
as_objectMethod · 0.45
borrowMethod · 0.45
iterMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected