(py: Python, t: &PyTuple, expected_length: usize)
| 94 | } |
| 95 | |
| 96 | fn wrong_tuple_length(py: Python, t: &PyTuple, expected_length: usize) -> PyErr { |
| 97 | let msg = format!( |
| 98 | "Expected tuple of length {}, but got tuple of length {}.", |
| 99 | expected_length, |
| 100 | t.len(py) |
| 101 | ); |
| 102 | PyErr::new_lazy_init( |
| 103 | py.get_type::<exc::ValueError>(), |
| 104 | Some(msg.to_py_object(py).into_object()), |
| 105 | ) |
| 106 | } |
| 107 | |
| 108 | macro_rules! tuple_conversion ({$length:expr,$(($refN:ident, $n:tt, $T:ident)),+} => { |
| 109 | /// Converts a Rust tuple to a Python `tuple`. |
nothing calls this directly
no test coverage detected