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

Method is_instance

crates/vm/src/protocol/object.rs:618–620  ·  view source on GitHub ↗

Determines if `self` is an instance of `cls`, either directly, indirectly or virtually via the __instancecheck__ magic method.

(&self, cls: &Self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

616 /// Determines if `self` is an instance of `cls`, either directly, indirectly or virtually via
617 /// the __instancecheck__ magic method.
618 pub fn is_instance(&self, cls: &Self, vm: &VirtualMachine) -> PyResult<bool> {
619 self.object_recursive_isinstance(cls, vm)
620 }
621
622 // This is object_recursive_isinstance from CPython's Objects/abstract.c
623 fn object_recursive_isinstance(&self, cls: &Self, vm: &VirtualMachine) -> PyResult<bool> {

Callers 11

exception_group_matchFunction · 0.80
execute_instructionMethod · 0.80
isinstanceFunction · 0.80
from_paramMethod · 0.80
from_paramMethod · 0.80
set_contentsMethod · 0.80
from_paramMethod · 0.80
new_simple_typeFunction · 0.80
from_paramMethod · 0.80
from_paramMethod · 0.80
__instancecheck__Method · 0.80

Calls 1

Tested by

no test coverage detected