Skip to content
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

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

Merged
merged 2 commits into from Jan 6, 2020

Conversation

@YoSTEALTH
Copy link
Contributor

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.

This comment has been minimized.

Copy link
@ericvsmith

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.

Copy link
@YoSTEALTH

YoSTEALTH Jan 6, 2020

Author Contributor

updated content

@ethanfurman ethanfurman self-assigned this Jan 6, 2020
@@ -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.

Copy link
@ericvsmith

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.

Copy link
@ethanfurman

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:

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

This comment has been minimized.

Copy link
@ethanfurman

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.

Copy link
@YoSTEALTH

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.

Copy link
@ericvsmith

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.

Copy link
@YoSTEALTH

YoSTEALTH Jan 6, 2020

Author Contributor

@ericvsmith i recreated it #17878

@ethanfurman ethanfurman merged commit 2e9012a into python:master Jan 6, 2020
5 checks passed
5 checks passed
Docs
Details
Azure Pipelines PR #20200106.39 succeeded
Details
bedevere/issue-number Issue number 39234 found
Details
bedevere/news "skip news" label found
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Jan 6, 2020

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

This comment has been minimized.

Copy link

bedevere-bot commented Jan 6, 2020

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

@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Jan 6, 2020

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

miss-islington added 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 <35307184+YoSTEALTH@users.noreply.github.com>
gousaiyang added a commit to gousaiyang/cpython that referenced this pull request Jan 8, 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
Projects
None yet
6 participants
You can’t perform that action at this time.