From 6a8a20748f82f6959e0ce28823f5b98610e1989c Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Tue, 26 Dec 2023 15:35:01 +0000 Subject: [PATCH] implement `IntoPy>` for `Bound` --- src/types/tuple.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/types/tuple.rs b/src/types/tuple.rs index 35a6bab16c7..78c4d0e6997 100644 --- a/src/types/tuple.rs +++ b/src/types/tuple.rs @@ -624,6 +624,12 @@ impl<'a, 'py> ExactSizeIterator for BorrowedTupleIterator<'a, 'py> { impl FusedIterator for BorrowedTupleIterator<'_, '_> {} +impl IntoPy> for Bound<'_, PyTuple> { + fn into_py(self, _: Python<'_>) -> Py { + self.unbind() + } +} + #[cold] fn wrong_tuple_length(t: &PyTuple, expected_length: usize) -> PyErr { let msg = format!(