-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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.__str__
change could be improved in What's New
#98250
Comments
mdboom
changed the title
Oct 13, 2022
Enum.__str__
change should be more clear in What's NewEnum.__str__
change could be improved in What's New
I'm more than happy to have help crafting a better What's New entry. Keep in mind that the change you are talking about is |
mdboom
added a commit
to mdboom/cpython
that referenced
this issue
Oct 14, 2022
33 tasks
CAM-Gerlach
added a commit
to CAM-Gerlach/cpython
that referenced
this issue
Oct 15, 2022
Hey, I didn't see this before I first submitted #98295, but I'd noticed something similar, and I've revised that PR to further resolve this issue. |
ezio-melotti
pushed a commit
that referenced
this issue
Oct 18, 2022
* Whatsnew: Convert literals in enum section to actual x-references * Whatsnew: Rewrite enum section for clear and consistant phrasing * Whatsnew: Combine directly related enum items instead of seperating them * gh-98250: Describe __str__/__format__ changes more clearly/accurately * Tweak enum section language per feedback from Ethan
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Oct 18, 2022
) * Whatsnew: Convert literals in enum section to actual x-references * Whatsnew: Rewrite enum section for clear and consistant phrasing * Whatsnew: Combine directly related enum items instead of seperating them * pythongh-98250: Describe __str__/__format__ changes more clearly/accurately * Tweak enum section language per feedback from Ethan (cherry picked from commit 73e5180) Co-authored-by: C.A.M. Gerlach <[email protected]>
miss-islington
added a commit
that referenced
this issue
Oct 18, 2022
* Whatsnew: Convert literals in enum section to actual x-references * Whatsnew: Rewrite enum section for clear and consistant phrasing * Whatsnew: Combine directly related enum items instead of seperating them * gh-98250: Describe __str__/__format__ changes more clearly/accurately * Tweak enum section language per feedback from Ethan (cherry picked from commit 73e5180) Co-authored-by: C.A.M. Gerlach <[email protected]>
pablogsal
pushed a commit
that referenced
this issue
Oct 22, 2022
* Whatsnew: Convert literals in enum section to actual x-references * Whatsnew: Rewrite enum section for clear and consistant phrasing * Whatsnew: Combine directly related enum items instead of seperating them * gh-98250: Describe __str__/__format__ changes more clearly/accurately * Tweak enum section language per feedback from Ethan (cherry picked from commit 73e5180) Co-authored-by: C.A.M. Gerlach <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#30582 (in 3.11) introduced a change to
Enum.__str__
so that it shows the enum name and the member name, whereas prior it only included the member name.This could be a breaking change in some cases. As an example in real world code, the Azure CLI uses enums for the acceptable values of command-line flags, and then uses
str
on the enum to generate the string that is passed to the subprocess as arguments.For example, this enum is used to define a "compute model":
And then it's used here to construct arguments for a subprocess:
The changelog entry for this change just says:
This is unlikely to be easily findable for users running into this change, since
StrEnum
doesn't exist in Python 3.10, and it's a little obscure. I would suggest:Does this make sense? Are there other cases I'm missing? Happy to file a PR, but thought I would get some discussion first.
The text was updated successfully, but these errors were encountered: