pyo3 icon indicating copy to clipboard operation
pyo3 copied to clipboard

add `#[pymodule] mod some_module { ... }`

Open davidhewitt opened this issue 3 years ago • 0 comments

Implements using #[pymodule] directly on modules.

Allows importing other wrapped items with a #[pyo3] use foo;. (Builds on #2366 to do this.)

Allows having a #[pymodule_init] function to run arbitrary code after adding all wrapped items.

Still very unfinished, hopefully it's an interesting proof-of-concept.

See the declarative module in test_module.rs and also pytests/src/lib.rs for examples of how this could be used.

davidhewitt avatar May 10 '22 22:05 davidhewitt