Skip to content

Commit f7da91a

Browse files
committed
implement PyTupleMethods
1 parent 066e334 commit f7da91a

File tree

5 files changed

+363
-67
lines changed

5 files changed

+363
-67
lines changed

src/instance.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,10 @@ impl<'py, T> Borrowed<'py, 'py, T>
325325
where
326326
T: HasPyGilRef,
327327
{
328-
// pub(crate) fn into_gil_ref(self) -> &'py T::AsRefTarget {
329-
// // Safety: self is a borrow over `'py`.
330-
// unsafe { self.py().from_borrowed_ptr(self.0.as_ptr()) }
331-
// }
328+
pub(crate) fn into_gil_ref(self) -> &'py T::AsRefTarget {
329+
// Safety: self is a borrow over `'py`.
330+
unsafe { self.py().from_borrowed_ptr(self.0.as_ptr()) }
331+
}
332332
}
333333

334334
impl<T> std::fmt::Debug for Borrowed<'_, '_, T> {

src/prelude.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ pub use crate::types::mapping::PyMappingMethods;
3737
pub use crate::types::sequence::PySequenceMethods;
3838
pub use crate::types::set::PySetMethods;
3939
pub use crate::types::string::PyStringMethods;
40+
pub use crate::types::tuple::PyTupleMethods;

src/types/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub mod iter {
8080
pub use super::frozenset::{BoundFrozenSetIterator, PyFrozenSetIterator};
8181
pub use super::list::{BoundListIterator, PyListIterator};
8282
pub use super::set::{BoundSetIterator, PySetIterator};
83-
pub use super::tuple::PyTupleIterator;
83+
pub use super::tuple::{BorrowedTupleIterator, BoundTupleIterator, PyTupleIterator};
8484
}
8585

8686
// Implementations core to all native types
@@ -305,5 +305,5 @@ pub(crate) mod set;
305305
mod slice;
306306
pub(crate) mod string;
307307
mod traceback;
308-
mod tuple;
308+
pub(crate) mod tuple;
309309
mod typeobject;

0 commit comments

Comments
 (0)