py_fn! currently requires a Python parameter, meaning that the GIL is always held when the function body is entered.
It would be very neat to not require this parameter, and when it was not included, release the GIL after preparing the arguments of the function and before calling it.
Concretely, this would reduce the boilerplate of "doing the right thing" (not holding the GIL through native code unless necessary) from:
fn my_function(py: Python, argument: String) -> Result<..> {
py.allow_threads(|| {
// do something with `argument`
..
})
}
...to:
fn my_function(argument: String) -> Result<..> {
// do something with `argument`
..
}