pyo3
pyo3 copied to clipboard
Rust bindings for the Python interpreter
The guide [states](https://pyo3.rs/v0.16.4/class.html#class-attributes): > Note that unlike class variables defined in Python code, class attributes defined in Rust cannot be mutated at all But this is in fact possible: ```rust...
Inspired by https://github.com/PyO3/pyo3/pull/2269#issuecomment-1087901951, this is an issue to track all of the places which we know need to change for full PEP 489 compatibility (draft implementation in #2245). The latest...
My Environment: Operating system and version: Windows 10 Python version: 3.8.3 How did I install python: Anaconda default Python installation Did I use a virtualenv?: yes, I use a virtualenv...
Like we have `#[pyclass(unsendable)]` to opt-out of `Send`, many users will not want their pyclass to be mutable. It would be nice if we could allow them to opt-out of...
This is throwing out a concept that I've been pondering for a while to progress with the design of the to-python conversion traits. It replaces `IntoPy` generic trait with a...
Code: ```rust use pyo3::prelude::*; use pyo3::py_run; use pyo3::{PyTraverseError, PyVisit}; #[pyclass] struct GcIntegration { self_ref: PyObject, } #[pymethods] impl GcIntegration { fn __traverse__(&self, visit: PyVisit
## Context I am trying to wrap a few Rust objects in a Python API - basically an enum of a few different types. ```rust enum Things { Obj1(String), Obj2(f64),...
### Bug Description When trying to build optional arguments, using `from_py_with` I'm getting ``` expected struct `InnerType`, found enum `Option` ``` ### Steps to Reproduce ```rs fn build_regex(obj: &PyAny) ->...
In comment to `Py::as_bytes`: ---- I think there's a few other immutable types like `str` and `tuple` which I guess can also have treatment like this where `py` is necessary...
Just wanted to ask: New versions of Python have added support for pattern matching ([PEP 622](https://www.python.org/dev/peps/pep-0622/#reference-implementation)): ```python def make_point_3d(pt): match pt: case (x, y): return Point3d(x, y, 0) case (x,...