Skip to content

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

Merged
merged 2 commits into from
Jan 6, 2020
Merged

bpo-39234: Doc: enum.auto() incrementation value not specified. #17872

merged 2 commits into from
Jan 6, 2020

Conversation

YoSTEALTH
Copy link
Contributor

@YoSTEALTH YoSTEALTH commented Jan 6, 2020

enum in C starts at 0, while enum.auto() in Python starts at 1, thus needs to be specified.

https://bugs.python.org/issue39234

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.
Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

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.

Copy link
Member

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:

https://www.divio.com/blog/documentation/

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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

@miss-islington
Copy link
Contributor

Thanks @YoSTEALTH for the PR, and @ethanfurman for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-17875 is a backport of this pull request to the 3.8 branch.

@bedevere-bot
Copy link

GH-17876 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 6, 2020
…thonGH-17872)

* `enum.auto()` initial value is now specified as being `1`.
(cherry picked from commit 2e9012a)

Co-authored-by: YoSTEALTH <[email protected]>
ned-deily pushed a commit that referenced this pull request Jan 25, 2020
ned-deily pushed a commit that referenced this pull request Jan 25, 2020
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
…thonGH-17872)

* `enum.auto()` initial value is now specified as being `1`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants