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

Method check

crates/vm/src/exception_group.rs:432–441  ·  view source on GitHub ↗
(&self, exc: &PyObject, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

430
431 impl ConditionMatcher {
432 fn check(&self, exc: &PyObject, vm: &VirtualMachine) -> PyResult<bool> {
433 match self {
434 ConditionMatcher::Type(typ) => Ok(exc.fast_isinstance(typ)),
435 ConditionMatcher::Types(types) => Ok(types.iter().any(|t| exc.fast_isinstance(t))),
436 ConditionMatcher::Callable(func) => {
437 let result = func.call((exc.to_owned(),), vm)?;
438 result.try_to_bool(vm)
439 }
440 }
441 }
442 }
443
444 fn derive_and_copy_attributes(

Callers 2

subgroupMethod · 0.45
splitMethod · 0.45

Calls 5

fast_isinstanceMethod · 0.80
try_to_boolMethod · 0.80
iterMethod · 0.45
callMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected