Skip to content

enum.IntEnum members should be valid tuple index #272

Closed
@scott-ainsworth

Description

@scott-ainsworth

The error message "Tuple index must be an integer literal" is produced by the following code:

import enum

class X(enum.IntEnum):
    a = 0
    b = 1

t = ('a', 'b')
print(t[X.a])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions