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

enum.auto() incrementation value not specified. #83415

Closed
YoSTEALTH mannequin opened this issue Jan 6, 2020 · 7 comments
Closed

enum.auto() incrementation value not specified. #83415

YoSTEALTH mannequin opened this issue Jan 6, 2020 · 7 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes docs Documentation in the Doc dir

Comments

@YoSTEALTH
Copy link
Mannequin

YoSTEALTH mannequin commented Jan 6, 2020

BPO 39234
Nosy @ericvsmith, @ned-deily, @ethanfurman, @YoSTEALTH, @miss-islington
PRs
  • bpo-39234: Doc: enum.auto() incrementation value not specified. #17872
  • [3.8] bpo-39234: Doc: enum.auto() incrementation value not specified. (GH-17872) #17875
  • [3.7] bpo-39234: Doc: enum.auto() incrementation value not specified. (GH-17872) #17876
  • bpo-39234: enum.auto() default initial value as 1 #17878
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-01-07.01:45:39.074>
    created_at = <Date 2020-01-06.19:10:39.219>
    labels = ['3.7', '3.8', '3.9', 'docs']
    title = '`enum.auto()` incrementation value not specified.'
    updated_at = <Date 2020-01-25.19:41:57.482>
    user = 'https://github.com/YoSTEALTH'

    bugs.python.org fields:

    activity = <Date 2020-01-25.19:41:57.482>
    actor = 'ned.deily'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2020-01-07.01:45:39.074>
    closer = 'eric.smith'
    components = ['Documentation']
    creation = <Date 2020-01-06.19:10:39.219>
    creator = 'YoSTEALTH'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39234
    keywords = ['patch']
    message_count = 7.0
    messages = ['359452', '359461', '359463', '359472', '359487', '360705', '360706']
    nosy_count = 6.0
    nosy_names = ['eric.smith', 'ned.deily', 'docs@python', 'ethan.furman', 'YoSTEALTH', 'miss-islington']
    pr_nums = ['17872', '17875', '17876', '17878']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue39234'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @YoSTEALTH
    Copy link
    Mannequin Author

    YoSTEALTH mannequin commented Jan 6, 2020

    # enum in C
    # ---------
    enum {
    a,
    b,
    c
    }
    # a = 0
    # b = 1
    # b = 2

    # enum in Python
    # --------------

    class Count(enum.IntEnum):
        a = enum.auto()
        b = enum.auto()
        c = enum.auto()
    # a = 1
    # b = 2
    # b = 3

    I am not sure why the enum.auto() starts with 1 in Python but this has just wasted a week worth of my time.

    @YoSTEALTH YoSTEALTH mannequin added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes labels Jan 6, 2020
    @YoSTEALTH YoSTEALTH mannequin assigned docspython Jan 6, 2020
    @YoSTEALTH YoSTEALTH mannequin added docs Documentation in the Doc dir 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes labels Jan 6, 2020
    @YoSTEALTH YoSTEALTH mannequin assigned docspython Jan 6, 2020
    @YoSTEALTH YoSTEALTH mannequin added the docs Documentation in the Doc dir label Jan 6, 2020
    @ethanfurman
    Copy link
    Member

    auto() starts with 1 because Enum numbering starts at 1 (which is in the docs, albeit buried in the Functional API section).

    Thank you for your effort to save somebody else from that frustration, though, I appreciate it.

    @ethanfurman
    Copy link
    Member

    New changeset 2e9012a by Ethan Furman (YoSTEALTH) in branch 'master':
    bpo-39234: Doc: enum.auto() incrementation value not specified. (GH-17872)
    2e9012a

    @miss-islington
    Copy link
    Contributor

    New changeset 24bcefc by Miss Islington (bot) (YoSTEALTH) in branch 'master':
    bpo-39234: enum.auto() default initial value as 1 (GH-17878)
    24bcefc

    @ericvsmith
    Copy link
    Member

    Thanks for the PRs.

    @ned-deily
    Copy link
    Member

    New changeset eec7636 by Ned Deily (Miss Islington (bot)) in branch '3.8':
    bpo-39234: Doc: enum.auto() incrementation value not specified. (GH-17872) (GH-17875)
    eec7636

    @ned-deily
    Copy link
    Member

    New changeset b0a6ec2 by Ned Deily (Miss Islington (bot)) in branch '3.7':
    bpo-39234: Doc: enum.auto() incrementation value not specified. (GH-17872) (GH-17876)
    b0a6ec2

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants