The py_fn!()-macro can translate between Python and Rust values, so you can use `&str`, `i32` or `String` in the signature of a function callable from Python. The first argument of type `Python<'p>` is used to indicate that your function may assume that the current thread holds the global interpreter lock. Most functions in the `cpython` crate require that you pass this argument.
(_: Python, a: &str, b: i32)
| 18 | // function may assume that the current thread holds the global interpreter lock. |
| 19 | // Most functions in the `cpython` crate require that you pass this argument. |
| 20 | fn func(_: Python, a: &str, b: i32) -> PyResult<String> { |
| 21 | Ok(format!("func({}, {})", a, b)) |
| 22 | } |
| 23 | |
| 24 | fn run(py: Python, args: &PyTuple, kwargs: Option<&PyDict>) -> PyResult<PyNone> { |
| 25 | println!("Rust says: Hello Python!"); |
nothing calls this directly
no outgoing calls
no test coverage detected