Skip to content

Commit

Permalink
implement PySequenceMethods
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Dec 8, 2023
1 parent 24d9113 commit 728b93e
Show file tree
Hide file tree
Showing 4 changed files with 331 additions and 91 deletions.
2 changes: 1 addition & 1 deletion src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl<'py, T> Py2<'py, T> {
#[doc(hidden)] // public and doc(hidden) to use in examples and tests for now
pub fn borrowed_from_gil_ref<'a>(gil_ref: &'a &'py T::AsRefTarget) -> &'a Self
where
T: PyTypeInfo,
T: HasPyGilRef,
{
// Safety: &'py T::AsRefTarget is expected to be a Python pointer,
// so &'a &'py T::AsRefTarget has the same layout as &'a Py2<'py, T>
Expand Down
5 changes: 3 additions & 2 deletions src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ pub use pyo3_macros::{pyclass, pyfunction, pymethods, pymodule, FromPyObject};
pub use crate::wrap_pyfunction;

// Expected to become public API in 0.21
// pub(crate) use crate::instance::Py2; // Will be stabilized with a different name
// pub(crate) use crate::types::any::PyAnyMethods;
pub(crate) use crate::instance::Py2; // Will be stabilized with a different name
pub(crate) use crate::types::any::PyAnyMethods;
// pub(crate) use crate::types::sequence::PySequenceMethods;
2 changes: 1 addition & 1 deletion src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ mod notimplemented;
mod num;
#[cfg(not(PyPy))]
mod pysuper;
mod sequence;
pub(crate) mod sequence;
pub(crate) mod set;
mod slice;
mod string;
Expand Down
Loading

0 comments on commit 728b93e

Please sign in to comment.