-
Notifications
You must be signed in to change notification settings - Fork 852
Introspection: modules associated constants #5150
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
Conversation
How can i add labels? (to skip the changelog check) |
Thank you! For the labels, I think you need some rights on this repo to do that. On the MR itself:
|
Actually I think we probably do want changelog entries for these additions now, as the original version of this introspection shipped in 0.25. It would be good to document improvements to it as future releases come. |
Currently, constants defined outside a module and then re-exported are not supported. If we eventually decide to go with the What do you think? |
b9ce68c
to
f773ba9
Compare
Indeed. However, I would feel better to have an as open to evolution introspection data format as possible: the pyo3-introspection crate will be a dependency of eg. Maturin so we having forward and backward compatibility as much as possible would be amazing. I believe we can always add I am also a bit scared about What about having a dumb but easy behavior like: const PI: f64 = std::f64::consts::PI; emits: PI: typing.Final = ... and in a follow up MR: PI: typing.Final[float] = ... and const PI: f64 = 3.14; emit: PI: typing.Final = 3.14 What do you think? In this case, having a |
f773ba9
to
deb829e
Compare
I think it's a bit odd to implement it this way without the
You're right!
On second thought, I agree with you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I think it's a bit odd to implement it this way without the pyconst macro, I'm open to implement the macro in this PR if you think that's the right approach.
I tend to think it's out of scope of this PR. But I would love to see it in a follow-up if PyO3 maintainers agree.
This MR looks good to me, but I do not have merge right on PyO3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3a4c0a1
to
d43c139
Compare
* Adds introspection for modules associated constants * Add support for `Final` constants. * Document changes * Review fixes * Fix typo
* Adds introspection for modules associated constants * Add support for `Final` constants. * Document changes * Review fixes * Fix typo
No description provided.