Struct cpython::oldstyle::PyClass[][src]

pub struct PyClass(_);

Represents an old-style Python class.

Only available with Python 2.x.

Implementations

impl PyClass[src]

pub fn is_subclass_of(&self, _py: Python<'_>, base: &PyClass) -> bool[src]

Return true if self is a subclass of base.

pub fn create_instance<T>(
    &self,
    py: Python<'_>,
    args: T,
    kw: Option<&PyDict>
) -> PyResult<PyInstance> where
    T: ToPyObject<ObjectType = PyTuple>, 
[src]

Create a new instance of the class. The parameters args and kw are used as the positional and keyword parameters to the object’s constructor.

pub fn create_instance_raw(
    &self,
    py: Python<'_>,
    dict: &PyDict
) -> PyResult<PyInstance>
[src]

Create a new instance of a specific class without calling its constructor. The dict parameter will be used as the object’s dict.

Trait Implementations

impl<'s> FromPyObject<'s> for PyClass[src]

impl<'s> FromPyObject<'s> for &'s PyClass[src]

impl PythonObject for PyClass[src]

unsafe fn unchecked_downcast_from(obj: PyObject) -> Self[src]

Unchecked downcast from PyObject to Self. Undefined behavior if the input object does not have the expected type.

unsafe fn unchecked_downcast_borrow_from<'a>(obj: &'a PyObject) -> &'a Self[src]

Unchecked downcast from PyObject to Self. Undefined behavior if the input object does not have the expected type.

impl PythonObjectWithCheckedDowncast for PyClass[src]

impl PythonObjectWithTypeObject for PyClass[src]

impl ToPyObject for PyClass[src]

Identity conversion: allows using existing PyObject instances where T: ToPyObject is expected.

type ObjectType = PyClass

Auto Trait Implementations

impl RefUnwindSafe for PyClass[src]

impl Send for PyClass[src]

impl Sync for PyClass[src]

impl Unpin for PyClass[src]

impl UnwindSafe for PyClass[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.