Skip to content

Commit

Permalink
guide: don't use ::pyo3
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Aug 23, 2022
1 parent ef8ccc0 commit af60a35
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
28 changes: 14 additions & 14 deletions guide/src/class.md
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,8 @@ struct MyClass {
# #[allow(dead_code)]
num: i32,
}
unsafe impl ::pyo3::type_object::PyTypeInfo for MyClass {
type AsRefTarget = ::pyo3::PyCell<Self>;
unsafe impl pyo3::type_object::PyTypeInfo for MyClass {
type AsRefTarget = pyo3::PyCell<Self>;
const NAME: &'static str = "MyClass";
const MODULE: ::std::option::Option<&'static str> = ::std::option::Option::None;
#[inline]
Expand All @@ -963,27 +963,27 @@ unsafe impl ::pyo3::type_object::PyTypeInfo for MyClass {
}
}

impl ::pyo3::PyClass for MyClass {
impl pyo3::PyClass for MyClass {
type Frozen = pyo3::pyclass::boolean_struct::False;
}

impl<'a, 'py> ::pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'py> for &'a MyClass
impl<'a, 'py> pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'py> for &'a MyClass
{
type Holder = ::std::option::Option<::pyo3::PyRef<'py, MyClass>>;
type Holder = ::std::option::Option<pyo3::PyRef<'py, MyClass>>;

#[inline]
fn extract(obj: &'py ::pyo3::PyAny, holder: &'a mut Self::Holder) -> ::pyo3::PyResult<Self> {
::pyo3::impl_::extract_argument::extract_pyclass_ref(obj, holder)
fn extract(obj: &'py pyo3::PyAny, holder: &'a mut Self::Holder) -> pyo3::PyResult<Self> {
pyo3::impl_::extract_argument::extract_pyclass_ref(obj, holder)
}
}

impl<'a, 'py> ::pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'py> for &'a mut MyClass
impl<'a, 'py> pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'py> for &'a mut MyClass
{
type Holder = ::std::option::Option<::pyo3::PyRefMut<'py, MyClass>>;
type Holder = ::std::option::Option<pyo3::PyRefMut<'py, MyClass>>;

#[inline]
fn extract(obj: &'py ::pyo3::PyAny, holder: &'a mut Self::Holder) -> ::pyo3::PyResult<Self> {
::pyo3::impl_::extract_argument::extract_pyclass_ref_mut(obj, holder)
fn extract(obj: &'py pyo3::PyAny, holder: &'a mut Self::Holder) -> pyo3::PyResult<Self> {
pyo3::impl_::extract_argument::extract_pyclass_ref_mut(obj, holder)
}
}

Expand All @@ -1001,9 +1001,9 @@ impl pyo3::impl_::pyclass::PyClassImpl for MyClass {
type BaseType = PyAny;
type ThreadChecker = pyo3::impl_::pyclass::ThreadCheckerStub<MyClass>;
type PyClassMutability = <<pyo3::PyAny as pyo3::impl_::pyclass::PyClassBaseType>::PyClassMutability as pyo3::impl_::pycell::PyClassMutability>::MutableChild;
type Dict = ::pyo3::impl_::pyclass::PyClassDummySlot;
type WeakRef = ::pyo3::impl_::pyclass::PyClassDummySlot;
type BaseNativeType = ::pyo3::PyAny;
type Dict = pyo3::impl_::pyclass::PyClassDummySlot;
type WeakRef = pyo3::impl_::pyclass::PyClassDummySlot;
type BaseNativeType = pyo3::PyAny;

fn items_iter() -> pyo3::impl_::pyclass::PyClassItemsIter {
use pyo3::impl_::pyclass::*;
Expand Down
6 changes: 3 additions & 3 deletions src/pycell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
//! #
//! // This function is exported to Python.
//! unsafe extern "C" fn __pymethod_increment__(
//! _slf: *mut ::pyo3::ffi::PyObject,
//! _args: *mut ::pyo3::ffi::PyObject,
//! ) -> *mut ::pyo3::ffi::PyObject {
//! _slf: *mut pyo3::ffi::PyObject,
//! _args: *mut pyo3::ffi::PyObject,
//! ) -> *mut pyo3::ffi::PyObject {
//! use :: pyo3 as _pyo3;
//! let gil = _pyo3::GILPool::new();
//! let _py = gil.python();
Expand Down

0 comments on commit af60a35

Please sign in to comment.