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 26, 2023
1 parent a69e6ba commit 57b5232
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/types/tuple.rs
Expand Up @@ -618,6 +618,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 57b5232

Please sign in to comment.