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

Support Enum keyword arguments #4184

Closed
JukkaL opened this issue Nov 1, 2017 · 3 comments
Closed

Support Enum keyword arguments #4184

JukkaL opened this issue Nov 1, 2017 · 3 comments

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Nov 1, 2017

enum.Enum(...) accepts keyword arguments such as module, but mypy complains about them.

Example from #2306 (comment):

from enum import Enum

# Error: Too many arguments for Enum()
PictureSize = Enum('PictureSize', 'P0 P1 P2 P3 P4 P5 P6 P7 P8', type=str, module=__name__)

Documentation: https://docs.python.org/3/library/enum.html#functional-api

@anentropic
Copy link

I made an attempt to fix this in typeshed, please review when you have time, thanks

@elazarg
Copy link
Contributor

elazarg commented Nov 13, 2017

Related namedtuple issues: #2127 #2124

@97littleleaf11
Copy link
Collaborator

Has been fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants