-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-39234: Doc: enum.auto()
incrementation value not specified.
#17872
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
enum in C starts at 0, while `enum.auto()` in Python starts at 1, thus needs to be specified.
Doc/library/enum.rst
Outdated
@@ -56,6 +56,7 @@ helper, :class:`auto`. | |||
.. class:: auto | |||
|
|||
Instances are replaced with an appropriate value for Enum members. | |||
Increment starts at 1 not 0. |
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.
There's an extraneous line break here. It's not the increment that starts at 1, but the initial value. Also, the "not 0" text isn't needed.
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.
updated content
@@ -55,7 +55,7 @@ helper, :class:`auto`. | |||
|
|||
.. class:: auto | |||
|
|||
Instances are replaced with an appropriate value for Enum members. | |||
Instances are replaced with an appropriate value for Enum members. Initial value starts at 1. |
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.
You need two spaces after the period. I'm now thinking that this should say "By default, the initial value starts at 1", since it's possible to override it.
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.
@ericvsmith Someone needs to go through the Enum
docs and rewrite them. If no one else does I will later this year. For inspiration:
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.
@ericvsmith: Sorry I jumped the gun on that one. If @YoSTEALTH make that last change feel free to commit it.
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 am unable to edit this file, its already merged? do i have to recreate the pull request?
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.
@YoSTEALTH : It's been merged. I don't think it's super-important to fix, but if you want to create a new PR I'll merge it.
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.
@ericvsmith i recreated it #17878
Thanks @YoSTEALTH for the PR, and @ethanfurman for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
GH-17875 is a backport of this pull request to the 3.8 branch. |
GH-17876 is a backport of this pull request to the 3.7 branch. |
…thonGH-17872) * `enum.auto()` initial value is now specified as being `1`. (cherry picked from commit 2e9012a) Co-authored-by: YoSTEALTH <[email protected]>
…-17872) (GH-17875) (cherry picked from commit 2e9012a) Co-authored-by: YoSTEALTH <[email protected]>
…-17872) (GH-17876) (cherry picked from commit 2e9012a) Co-authored-by: YoSTEALTH <[email protected]>
…thonGH-17872) * `enum.auto()` initial value is now specified as being `1`.
enum in C starts at 0, while
enum.auto()
in Python starts at 1, thus needs to be specified.https://bugs.python.org/issue39234