# pyo3::type_object::PyTypeObject - Rust
Python object types that have a corresponding type object.
Keywords: rust, rustlang, rust-lang, PyTypeObject

# Trait pyo3::type_object::PyTypeObject [−] [src]

    pub unsafe trait PyTypeObject {
        fn type_object(py: Python<'_>) -> &PyType;
    }

Python object types that have a corresponding type object.

This trait is marked unsafe because not fulfilling the contract for type_object leads to UB.

See also PyTypeInfo::type_object_raw.

## Required methods

### `fn type_object(py: Python<'_>) -> &PyType` [src]

Returns the safe abstraction over the type object.

Loading content...

## Implementors

### `impl<T> PyTypeObject for T where
T: PyTypeInfo,` [src]

#### `fn type_object(py: Python<'_>) -> &PyType` [src]

Loading content...