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

Rudimentary support for Enum #715

Merged
merged 4 commits into from
Aug 10, 2015
Merged

Rudimentary support for Enum #715

merged 4 commits into from
Aug 10, 2015

Conversation

spkersten
Copy link
Contributor

This PR adds rudimentary support for Python 3.4's Enum type. The only thing it does is setting the type of Color.red to Color given class Color(Enum): red = 1.

While it doesn't check much, it suppresses the error that mypy currently reports for the most basic use of Enum.

@presidento
Copy link

Can you add tests for the new functionality?

@spkersten
Copy link
Contributor Author

@presidento Sure, but I've not time for that now. (I've to figure out how to make a Python 3.4 only test; not sure if that is currently possible.)

Also, the code needs to check that the version of Python is > 3.4.

@JukkaL
Copy link
Collaborator

JukkaL commented Jun 23, 2015

Currently Python version only affects mypy/test/data/pythoneval.test. You can add Python 3.4 only test cases easily by modifying python_34_eval_files in mypy/test/testpythoneval.py.

@o11c
Copy link
Contributor

o11c commented Jun 23, 2015

IMO instead of making it 3.4 only, it should add a dependency on enum34 for older versions.

@JukkaL
Copy link
Collaborator

JukkaL commented Jul 26, 2015

It would be great to get this PR in! Apologies for the delay -- I've been traveling a lot and moving (twice!) in the last month, but things are now getting back to normal.

@spkersten Can you have a look at the test failure?

@JukkaL JukkaL merged commit ba51921 into python:master Aug 10, 2015
@JukkaL
Copy link
Collaborator

JukkaL commented Aug 10, 2015

@o11c I created a task for this: #742

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

Successfully merging this pull request may close these issues.

4 participants