-
Notifications
You must be signed in to change notification settings - Fork 761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Macro attribute reworks #1601
Comments
I'll aim to implement each of these as individual PRs over the coming weeks heading into 0.14. If anyone else is interested in implementing any of these, please feel welcome to claim them on this issue! I can give further information if the notes above aren't clear enough in any spots. |
I think once #1650 is merged then I'm happy with the changes done in advance of the 0.14 release; I think the rest of the changes here can wait for a future release:
|
Closing this; the |
With #1567 merged we created the
#[pyo3(name = "...")]
attribute for#[pyfunction]
.For consistency we should also support this pattern in the other macros too:
#[pymodule]
(implemented in pymodule: accept#[pyo3(name = "...")]
option #1650)#[pyfn]
should become optional and support the#[pyo3(name = "...")]
syntax (implemented in pyfn: deprecate name argument #1610)#[pyo3(get, set, name = "...")]
on#[pyclass]
struct fields (including tuple structs, where setting the name will be required). (implemented in pyclass: allow#[pyo3(get, set, name = "foo")]
#1651)#[pyo3(getter, name = "...")]
and#[pyo3(setter, name = "...")]
in#[pymethods]
.There's also some other attributes which I would like to move to the
#[pyo3(...)]
namespace for the 0.14 release:#[text_signature]
on#[pyfunction]
and#[pymethods]
(implemented in text_signature: move to#[pyo3(text_signature = "...")]
#1658)#[args]
on#[pymethods]
(perhaps call it#[pyo3(signature = (...))]
instead? Or rename the undocumented signature merged in macros: support#[pyo3(name = "...")]
in pyfunction #1567 to#[pyo3(args = (...))]
)#[pyfunction(pass_module)]
->#[pyfunction] #[pyo3(pass_module)]
(implemented in macros: support#[pyo3(name = "...")]
in pyfunction #1567; documented in pyfunction: document#[pyo3(pass_module)]
#1659)Once we have all of these in place, we'll be much closer to a standard syntax for these attributes. This can lead to possible future improvements like a possible
#[pyo3]
macro (#1567 (comment), #211).The text was updated successfully, but these errors were encountered: