Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-39234: Doc: `enum.auto()` incrementation value not specified. #17872
Conversation
enum in C starts at 0, while `enum.auto()` in Python starts at 1, thus needs to be specified.
@@ -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. |
This comment has been minimized.
This comment has been minimized.
ericvsmith
Jan 6, 2020
Member
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.
This comment has been minimized.
This comment has been minimized.
@@ -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. |
This comment has been minimized.
This comment has been minimized.
ericvsmith
Jan 6, 2020
Member
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.
This comment has been minimized.
This comment has been minimized.
ethanfurman
Jan 6, 2020
Member
@ericvsmith Someone needs to go through the Enum
docs and rewrite them. If no one else does I will later this year. For inspiration:
This comment has been minimized.
This comment has been minimized.
ethanfurman
Jan 6, 2020
Member
@ericvsmith: Sorry I jumped the gun on that one. If @YoSTEALTH make that last change feel free to commit it.
This comment has been minimized.
This comment has been minimized.
YoSTEALTH
Jan 6, 2020
Author
Contributor
I am unable to edit this file, its already merged? do i have to recreate the pull request?
This comment has been minimized.
This comment has been minimized.
ericvsmith
Jan 6, 2020
Member
@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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Jan 6, 2020
Thanks @YoSTEALTH for the PR, and @ethanfurman for merging it |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 6, 2020
GH-17875 is a backport of this pull request to the 3.8 branch. |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 6, 2020
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 <35307184+YoSTEALTH@users.noreply.github.com>
…thonGH-17872) * `enum.auto()` initial value is now specified as being `1`.
…thonGH-17872) * `enum.auto()` initial value is now specified as being `1`.
…thonGH-17872) * `enum.auto()` initial value is now specified as being `1`.
…thonGH-17872) * `enum.auto()` initial value is now specified as being `1`.
YoSTEALTH commentedJan 6, 2020
•
edited by bedevere-bot
enum in C starts at 0, while
enum.auto()
in Python starts at 1, thus needs to be specified.https://bugs.python.org/issue39234