Allow #[pymodule] functions to take a single module arg#3905
Allow #[pymodule] functions to take a single module arg#3905davidhewitt merged 1 commit intoPyO3:mainfrom
#[pymodule] functions to take a single module arg#3905Conversation
732e890 to
bbf0956
Compare
davidhewitt
left a comment
There was a problem hiding this comment.
Thanks, this is something I've wanted for a while. Obviously the first two commits are still being finalised, hopefully they can land soon and then we can get this merged.
tests/test_no_imports.rs
Outdated
|
|
||
| #[pyo3::pymodule] | ||
| fn basic_module_bound( | ||
| _py: pyo3::Python<'_>, |
There was a problem hiding this comment.
Was this meant to take just a single argument?
| _py: pyo3::Python<'_>, |
|
Also, maybe in this PR let's update documentation to use this new one-argument form. (Or is that better for a follow up due to conflicts?) I think this form is strictly better and closer to what we'll eventually move to in #3900 |
I have changed the documentation to this one-arg form in #3899 which deprecates the |
|
Aha fab, I confess I'd not read that PR yet. Fine to leave there 👍 |
0c32203 to
bb00be8
Compare
|
Rebased now that #3897 is in. @davidhewitt, please take a look. |
After #3897. This was split off from #3899 and contains just the changes to the
#[pymodule]macro.