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

Allow class-based TypedDicts in all python versions #6971

Merged
merged 1 commit into from Jun 11, 2019

Conversation

@msullivan
Copy link
Collaborator

commented Jun 11, 2019

Entries can't be declared in versions that don't support type
annotations, of course, but class-based TypedDict still serves a
valuable purpose in merging TypedDicts together.

This error only triggers on empty TypedDicts, since any non-empty
ones would have failed earlier with a syntax error. So there is no
reason to prohibit it because we can handle that case totally fine.

Allow class-based TypedDicts in all python versions
Entries can't be *declared* in versions that don't support type
annotations, of course, but class-based TypedDict still serves a
valuable purpose in merging TypedDicts together.

This error *only* triggers on empty TypedDicts, since any non-empty
ones would have failed earlier with a syntax error. So there is no
reason to prohibit it because we can handle that case totally fine.

@msullivan msullivan requested a review from gvanrossum Jun 11, 2019

@gvanrossum
Copy link
Member

left a comment

LGTM! Let's get this into the next pin move.

@msullivan msullivan merged commit b9d0529 into master Jun 11, 2019

3 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@msullivan msullivan deleted the typeddict-classes branch Jun 11, 2019

PattenR added a commit to PattenR/mypy that referenced this pull request Jun 23, 2019

Allow class-based TypedDicts in all python versions (python#6971)
Entries can't be *declared* in versions that don't support type
annotations, of course, but class-based TypedDict still serves a
valuable purpose in merging TypedDicts together.

This error *only* triggers on empty TypedDicts, since any non-empty
ones would have failed earlier with a syntax error. So there is no
reason to prohibit it because we can handle that case totally fine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.