pyo3
pyo3 copied to clipboard
Rust bindings for the Python interpreter
`PyList::new` requires a infallible iterator which is sometimes awkward to use. Is this new API desirable?
## 🐛 Bug Reports Hi pyo3 community! Love your library! Basically, I would like to export the `__hash__` implementation from rust to python and to return an u128 hash out...
After creating a new exception using: ```rust create_exception!(my_module, MyException, ExceptionClass); ``` It is natural that I would want to make it available as an import within my python module: ```python...
[`PyDict::set_item`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/types/struct.PyDict.html#method.set_item) consumes the key and value, but uses `ToPyObject`. Shouldn't that be `IntoPyObject`? For `ToPyObject`, taking a reference would be sufficient. But it seems more efficient to consume and use...
I would be great to have a custom derive for exceptions, similar but more powerful than [create_exception](https://pyo3.rs/master/doc/pyo3/macro.create_exception.html). This would e.g. allow reimplementing [`JSONDecodeError`](https://docs.python.org/3/library/json.html#json.JSONDecodeError): ```rust #[pyexception(module = json)] struct JSONDecodeError {...
I'm very excited about this library. The effort going into documentation and ergonomics is fantastic. I've been waiting to use it on stable Rust for months, and have finally started...
when I use VSCode to debug programs, It will show dyld[85569]: Library not loaded: @rpath/Python3.framework/Versions/3.8/Python3
As of merging #1979 we now have a basic `#[pyclass(immutable)]` working on `main`. However, it is still undocumented, and the implementation was a bit rough around the edges. Below is...
I'd like to be able to use a `__del__` method in `#[pymethods]`, however it's not being called. There are two other related issue #402 and #774. #774 seems most relevant...
Compiles: ```rust use pyo3::prelude::*; #[pyclass] #[derive(Debug)] pub struct Foo { field: i32 } #[pymethods] impl Foo { #[new] pub fn new(field: i32) -> Self { Self { field } }...