implement `IntoPy<Py<PyTuple>>` for `Bound<PyTuple>`

This commit is contained in:
David Hewitt 2023-12-26 15:35:01 +00:00
parent 823b5feed3
commit 4cf58c8303
1 changed files with 6 additions and 0 deletions

View File

@ -622,6 +622,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!(