pyo3
Installation
SKILL.md
PyO3 (Rust-Python Bindings)
Scope
- Module initialization and class export.
- GIL management, free-threading (Python 3.13+), and
allow_threads. - Buffer protocol and zero-copy data transfer.
- Async bridging with
pyo3-async-runtimes. - Maturin build configuration and wheel distribution.
- Type stubs (
.pyi) for IDE support.
Module Setup
Cargo.toml
[lib]
name = "_core"
crate-type = ["cdylib", "rlib"] # cdylib for Python, rlib for Rust tests