script::python::rspython::utils

Function is_instance

source
pub fn is_instance<T: PyPayload>(obj: &PyObjectRef, vm: &VirtualMachine) -> bool
Expand description

use rustpython’s is_instance method to check if a PyObject is a instance of class. if PyResult is Err, then this function return false