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

View file

@ -622,6 +622,12 @@ impl<'a, 'py> ExactSizeIterator for BorrowedTupleIterator<'a, 'py> {
impl FusedIterator for BorrowedTupleIterator<'_, '_> {} impl FusedIterator for BorrowedTupleIterator<'_, '_> {}
impl IntoPy<Py<PyTuple>> for Bound<'_, PyTuple> {
fn into_py(self, _: Python<'_>) -> Py<PyTuple> {
self.unbind()
}
}
#[cold] #[cold]
fn wrong_tuple_length(t: &PyTuple, expected_length: usize) -> PyErr { fn wrong_tuple_length(t: &PyTuple, expected_length: usize) -> PyErr {
let msg = format!( let msg = format!(