pyo3
pyo3 copied to clipboard
Rust bindings for the Python interpreter
Future additions for the emscripten CI job: --- Well there's a couple more things I'm interested in: 1. I'd like to run the tests that mix Rust and C/C++. This...
I am trying to add my doc-string and an explicit signature for `__new__` and `__init__` to `Foo`: ~~~rust /// Foo(arg1, arg2) /// -- /// /// A Foo #[pyclass(name=Foo)] pub struct...
From https://github.com/PyO3/pyo3/runs/7940014067?check_suite_focus=true ```@given(dt=st.datetimes(MIN_DATETIME, MAX_DATETIME)) [174](https://github.com/PyO3/pyo3/runs/7940014067?check_suite_focus=true#step:20:175) @example(dt=pdt.datetime(1971, 1, 2, 0, 0)) [175](https://github.com/PyO3/pyo3/runs/7940014067?check_suite_focus=true#step:20:176) def test_datetime_from_timestamp(dt): [176](https://github.com/PyO3/pyo3/runs/7940014067?check_suite_focus=true#step:20:177) if PYPY and dt < pdt.datetime(1900, 1, 1): [177](https://github.com/PyO3/pyo3/runs/7940014067?check_suite_focus=true#step:20:178) pytest.xfail("pdt.datetime.timestamp will raise on PyPy with dates...
This issue replaces the closed #131. We need to provide a way to export an enum to Python.
It would be great to have a single `#[pyo3]` macro like the `#[wasm-bindgen]` macro in [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen). This macro would have the following properties: * It can be attached to functions,...
The `bytes` crate from Tokio is really useful for operating on bytes in a performant way: https://docs.rs/crate/bytes/1.1.0. We use it in Pants. I'd love to convert a `#[pyfunction]` we have...
I was struggling a while to get something like this to work: ```rust // Union-type for arguments to arithmetic operations. #[derive(FromPyObject)] pub enum IntOrElemArg), Literal(RugInteger), } impl` into the enum...
The modules in `src/ffi` have become a bit out-of-date, and also quite disorganised so it's kinda hard to figure out what's missing. Since Python 3.9 the cpython include files have...
For example, we can do ```rust #[args(a, "*", c = 3)] fn get&self, a: i32, b: i32, c: i32) -> PyResult { ... } ``` , where the position of...
I can't see `PyBuffer` mentioned anywhere in the guide... At the very least, we might want to add it to the [argument types](https://pyo3.rs/master/conversions.html#argument-types) section of `conversions.md`? Or maybe on [`types.md`](https://pyo3.rs/master/types.html).