[New-bugs-announce] [issue43744] enum: Adding a var named _anything__ raises IndexError

Matthias Urlichs report at bugs.python.org
Tue Apr 6 05:16:25 EDT 2021

New submission from Matthias Urlichs <matthias at urlichs.de>:

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"

components: Library (Lib)
messages: 390301
nosy: smurfix
priority: normal
severity: normal
status: open
title: enum: Adding a var named _anything__ raises IndexError
type: behavior
versions: Python 3.10

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list