classification
Title: enum: Adding a member named _classname__ raises IndexError
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ethan.furman Nosy List: barry, eli.bendersky, ethan.furman, smurfix
Priority: normal Keywords: patch

Created on 2021-04-06 09:16 by smurfix, last changed 2021-04-15 14:03 by ethan.furman. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 25349 merged ethan.furman, 2021-04-12 03:55
Messages (3)
msg390301 - (view) Author: Matthias Urlichs (smurfix) * Date: 2021-04-06 09:16
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"
msg390815 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2021-04-12 03:56
It should not be an error at all, but a False result.  PR created.
msg391137 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2021-04-15 13:58
New changeset ec09973f5b21d33550c834ddc89606b0e1c70ffd by Ethan Furman in branch 'master':
bpo-43744: [Enum] fix ``_is_private`` (GH-25349)
https://github.com/python/cpython/commit/ec09973f5b21d33550c834ddc89606b0e1c70ffd
History
Date User Action Args
2021-04-15 14:03:38ethan.furmansetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-04-15 13:58:40ethan.furmansetmessages: + msg391137
2021-04-12 03:56:24ethan.furmansetassignee: ethan.furman
messages: + msg390815
2021-04-12 03:55:01ethan.furmansetkeywords: + patch
stage: patch review
pull_requests: + pull_request24084
2021-04-06 11:13:02xtreaksetnosy: + barry, eli.bendersky, ethan.furman
2021-04-06 09:19:52smurfixsettitle: enum: Adding a member named _anything__ raises IndexError -> enum: Adding a member named _classname__ raises IndexError
2021-04-06 09:19:16smurfixsettitle: enum: Adding a var named _anything__ raises IndexError -> enum: Adding a member named _anything__ raises IndexError
2021-04-06 09:16:25smurfixcreate