Skip to content

enum.IntEnum members should be valid tuple index #272

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
scott-ainsworth opened this issue Jun 6, 2016 · 2 comments
Closed

enum.IntEnum members should be valid tuple index #272

scott-ainsworth opened this issue Jun 6, 2016 · 2 comments

Comments

@scott-ainsworth
Copy link

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])
@JukkaL
Copy link
Contributor

JukkaL commented Jun 7, 2016

This sounds like this might be a mypy issue. If you are using mypy, could you file this here: https://github.com/python/mypy/issues

@JelleZijlstra
Copy link
Member

I also don't think there's a typeshed bug here. The mypy problem is closely related to python/mypy#3078, so I'm not going to open a new mypy bug.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants