pyo3
pyo3 copied to clipboard
Rust bindings for the Python interpreter
I would like to run python from rust, but in my situation, end users who will run the program, haven't preinstalled python and it's not possible to install (their system...
This is similar to [`OnceCell::get_or_try_init`](https://docs.rs/once_cell/latest/once_cell/sync/struct.OnceCell.html#method.get_or_try_init) and is very useful for fallible initialization.
I don't think is possible to create a class like this in pyo3. I couldn't find a way to write an equality method in the docs. ```python class SomeClass: def...
As originally posted on Gitter by @microgravitas: > Hi y'all! Can anyone point me to an example of how to implement an Python iterator which does not copy the whole...
This issue is a placeholder issue which I'd like to use to keep track of what we need to do to support `async fn` for `#[pyfunction]` (and `#[pymethods]`). While this...
How difficult would it be to dual-license PyO3 under the Apache and MIT licenses, like Rust itself? This would work around the incompatibility between the Apache license and GPL 2....
I don't think it's possible for `#[new]` in PyO3 to return an existing object (at the moment), though it really should be. _Originally posted by @davidhewitt in https://github.com/PyO3/pyo3/discussions/2382#discussioncomment-2765288_
### Bug Description I have a pymethod using `#[args(...)]` to enforce kw-only arguments. However if there is a mismatch between the rust argument names and the `args(...)` names. If you...
Implements using `#[pymodule]` directly on modules. Allows importing other wrapped items with a `#[pyo3] use foo;`. (Builds on #2366 to do this.) Allows having a `#[pymodule_init]` function to run arbitrary...
I have a use-case where I need to evaluate some code and set args. It would be possible by exposing [`PyEval_EvalCodeEx`](https://docs.python.org/3/c-api/veryhigh.html#c.PyEval_EvalCodeEx) e.g. as a `Python::run_ex` method. Or perhaps call it...