Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Icxolu committed Mar 12, 2024
1 parent 3fab414 commit 5261d37
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion guide/src/class.md
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ struct MyClass {
num: i32,
}

impl pyo3::types::DerefToPyAny for MyClass {
impl pyo3::types::DerefToTarget for MyClass {
type Target = pyo3::PyAny;
}

Expand Down
2 changes: 1 addition & 1 deletion pyo3-macros-backend/src/pyclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ fn impl_class(
// FIXME https://github.com/PyO3/pyo3/issues/3903
#[allow(unknown_lints, non_local_definitions)]
const _: () = {
impl #pyo3_path::types::DerefToPyAny for #cls {
impl #pyo3_path::types::DerefToTarget for #cls {
type Target = #base;
}

Expand Down
4 changes: 2 additions & 2 deletions src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::pycell::{PyBorrowError, PyBorrowMutError};
use crate::pyclass::boolean_struct::{False, True};
use crate::type_object::HasPyGilRef;
use crate::types::{any::PyAnyMethods, string::PyStringMethods, typeobject::PyTypeMethods};
use crate::types::{DerefToPyAny, PyDict, PyString, PyTuple};
use crate::types::{DerefToTarget, PyDict, PyString, PyTuple};
use crate::{
ffi, AsPyPointer, DowncastError, FromPyObject, IntoPy, PyAny, PyClass, PyClassInitializer,
PyRef, PyRefMut, PyTypeInfo, Python, ToPyObject,
Expand Down Expand Up @@ -368,7 +368,7 @@ fn python_format(
// https://github.com/rust-lang/rust/issues/19509
impl<'py, T> Deref for Bound<'py, T>
where
T: DerefToPyAny,
T: DerefToTarget,
{
type Target = Bound<'py, T::Target>;

Expand Down
4 changes: 2 additions & 2 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub mod iter {
/// trait will be removed.
///
/// [1]: https://github.com/rust-lang/rust/issues/19509
pub trait DerefToPyAny {
pub trait DerefToTarget {
/// Target Type
type Target;
}
Expand Down Expand Up @@ -222,7 +222,7 @@ macro_rules! pyobject_native_type_named (
}
}

impl $crate::types::DerefToPyAny for $name {
impl $crate::types::DerefToTarget for $name {
type Target = $target;
}
};
Expand Down

0 comments on commit 5261d37

Please sign in to comment.