Skip to content

Commit

Permalink
implement IntoPy<Py<PyTuple>> for Bound<PyTuple>
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Dec 29, 2023
1 parent a3fe4dd commit 52697fa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/types/tuple.rs
Expand Up @@ -624,6 +624,12 @@ impl<'a, 'py> ExactSizeIterator for BorrowedTupleIterator<'a, 'py> {

impl FusedIterator for BorrowedTupleIterator<'_, '_> {}

impl IntoPy<Py<PyTuple>> for Bound<'_, PyTuple> {
fn into_py(self, _: Python<'_>) -> Py<PyTuple> {
self.unbind()
}
}

#[cold]
fn wrong_tuple_length(t: &PyTuple, expected_length: usize) -> PyErr {
let msg = format!(
Expand Down

0 comments on commit 52697fa

Please sign in to comment.