pyo3
pyo3 copied to clipboard
Rust bindings for the Python interpreter
Quick question on this: should we be allowing `#[pyo3(item)]` here? Is there any reasonable interpretation beside the elements always being item 0, item 1, item 2 etc? I wonder if...
Hi, I'm trying to pass custom objects through Python to Rust. I need to store one of these in a main struct. The Python classes have some properties of their...
I found some details making me a little confused when reading the docs, which I think can be improved. The first is about the argument parsing for `pyfunction` macro. I...
It allows smuggling Python types into the closure: ```rust use pyo3::prelude::*; use pyo3::types::PyString; use send_wrapper::SendWrapper; fn main() { Python::with_gil(|py| { let string = PyString::new(py, "foo"); let wrapped = SendWrapper::new(string); py.allow_threads(||...
Quoting Python docs for [`vars`](https://docs.python.org/3.8/library/functions.html#vars): > Objects such as modules and instances have an updateable `__dict__` attribute; however, other objects may have write restrictions on their `__dict__` attributes (for example,...
I have a crate in which I define a `PyClass`. This `PyClass` I want to use in a different crate from which I want to build a wheel using maturin....
### Bug Description If you try to call Python's hash function on an object for which you've implemented `__richcmp__`, it fails with `unhashable type`. The only fix I've found is...
## 🐛 Bug Reports Using the minimal setup below, which contains a `main.rs` and a `lib.rs`, I get the following linker error: ```log error: linking with `cc` failed: exit code:...
Some users have specific use cases where they would benefit from being able to access the `PYO3_CONFIG_FILE` values in some form from the `pyo3` crate. I generally wouldn't advise this,...
This is active branch to replace #1300 and #1304 See the discussions in those PRs to the motivation for the design (and some preliminary benchmarks). The idea is that we...