-
Notifications
You must be signed in to change notification settings - Fork 784
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
Enum naming improvements #2457
Enum naming improvements #2457
Conversation
34667fe
to
ad0eef4
Compare
f36cd12
to
b18d9cf
Compare
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.
I think it's better to name some struct and fns enum variant
instead of just variant
.
b18d9cf
to
033b9b4
Compare
I've applied the naming suggestions. |
033b9b4
to
d1cc393
Compare
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.
Thanks very much for this, and sorry I have been slow to review.
Implementation is very complete and docs are great 👍
Just one tiny tweak I'd like to see to contain the options inside the PyClassEnumVariant
struct (if it's straightforward to do so). Also need to rebase to fix the CHANGELOG merge conflict. Then let's merge!
d1cc393
to
ccb63b9
Compare
I've incorporated the suggested changes and fixed the merge conflict in the CHANGELOG. |
There is a clippy warning needs to be addressed. |
ccb63b9
to
845be04
Compare
Apologies, I forgot to run |
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.
Looks great - many thanks again!
This improves the interaction between
#[pyclass(name)]
andenum
s.First, the macro-defined name for the
enum
is used in theenum
's__repr__
implementation so that everything is kept consistent from the Python point of view.Secondly,
#[pyo3(name)]
is now supported on enum variants.