pub trait AsObjectwhere
    Self: Borrow<PyObject>,{
    // Provided methods
    fn as_object(&self) -> &PyObject { ... }
    fn get_id(&self) -> usize { ... }
    fn is<T>(&self, other: &T) -> bool
       where T: AsObject { ... }
    fn class(&self) -> &Py<PyType> { ... }
    fn get_class_attr(
        &self,
        attr_name: &'static PyStrInterned
    ) -> Option<PyObjectRef> { ... }
    fn fast_isinstance(&self, cls: &Py<PyType>) -> bool { ... }
}

Provided Methods§

source

fn as_object(&self) -> &PyObject

source

fn get_id(&self) -> usize

source

fn is<T>(&self, other: &T) -> boolwhere T: AsObject,

source

fn class(&self) -> &Py<PyType>

source

fn get_class_attr( &self, attr_name: &'static PyStrInterned ) -> Option<PyObjectRef>

source

fn fast_isinstance(&self, cls: &Py<PyType>) -> bool

Determines if obj actually an instance of cls, this doesn’t call instancecheck, so only use this if cls is known to have not overridden the base instancecheck magic method.

Implementors§

source§

impl<T> AsObject for Twhere T: Borrow<PyObject>,