Trait pyo3::type_object::PyTypeCheck
source · pub trait PyTypeCheck: HasPyGilRef {
const NAME: &'static str;
// Required method
fn type_check(object: &Bound<'_, PyAny>) -> bool;
}
Expand description
Implemented by types which can be used as a concrete Python type inside Py<T>
smart pointers.
Required Associated Constants§
Required Methods§
sourcefn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
Checks if object
is an instance of Self
, which may include a subtype.
This should be equivalent to the Python expression isinstance(object, Self)
.
Object Safety§
This trait is not object safe.