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: Adding a member named _classname__ raises IndexError #87910

Closed
smurfix mannequin opened this issue Apr 6, 2021 · 3 comments
Closed

enum: Adding a member named _classname__ raises IndexError #87910

smurfix mannequin opened this issue Apr 6, 2021 · 3 comments
Assignees
Labels
3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@smurfix
Copy link
Mannequin

smurfix mannequin commented Apr 6, 2021

BPO 43744
Nosy @warsaw, @smurfix, @ethanfurman
PRs
  • bpo-43744: [Enum] fix issue43744 #25349
  • 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 = 'https://github.com/ethanfurman'
    closed_at = <Date 2021-04-15.14:03:38.746>
    created_at = <Date 2021-04-06.09:16:25.127>
    labels = ['type-bug', 'library', '3.10']
    title = 'enum: Adding a member named _classname__ raises IndexError'
    updated_at = <Date 2021-04-15.14:03:38.746>
    user = 'https://github.com/smurfix'

    bugs.python.org fields:

    activity = <Date 2021-04-15.14:03:38.746>
    actor = 'ethan.furman'
    assignee = 'ethan.furman'
    closed = True
    closed_date = <Date 2021-04-15.14:03:38.746>
    closer = 'ethan.furman'
    components = ['Library (Lib)']
    creation = <Date 2021-04-06.09:16:25.127>
    creator = 'smurfix'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43744
    keywords = ['patch']
    message_count = 3.0
    messages = ['390301', '390815', '391137']
    nosy_count = 4.0
    nosy_names = ['barry', 'smurfix', 'eli.bendersky', 'ethan.furman']
    pr_nums = ['25349']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue43744'
    versions = ['Python 3.10']

    @smurfix
    Copy link
    Mannequin Author

    smurfix mannequin commented Apr 6, 2021

    While checking out the Enum implementation I noticed that this code snippet results in an IndexError.

    I have no idea which error or warning (if any) this should generate instead. Opinions?

        import enum
        class duh(enum.Enum):
            _duh__ = "moo"

    @smurfix smurfix mannequin added 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Apr 6, 2021
    @smurfix smurfix mannequin changed the title enum: Adding a var named _anything__ raises IndexError enum: Adding a member named _anything__ raises IndexError Apr 6, 2021
    @smurfix smurfix mannequin changed the title enum: Adding a var named _anything__ raises IndexError enum: Adding a member named _anything__ raises IndexError Apr 6, 2021
    @smurfix smurfix mannequin changed the title enum: Adding a member named _anything__ raises IndexError enum: Adding a member named _classname__ raises IndexError Apr 6, 2021
    @smurfix smurfix mannequin changed the title enum: Adding a member named _anything__ raises IndexError enum: Adding a member named _classname__ raises IndexError Apr 6, 2021
    @ethanfurman
    Copy link
    Member

    It should not be an error at all, but a False result. PR created.

    @ethanfurman
    Copy link
    Member

    New changeset ec09973 by Ethan Furman in branch 'master':
    bpo-43744: [Enum] fix _is_private (GH-25349)
    ec09973

    @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.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant