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

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.

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 June 11, 2019 19:04
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@msullivan msullivan merged commit b9d0529 into master Jun 11, 2019
@msullivan msullivan deleted the typeddict-classes branch June 11, 2019 21:32
PattenR pushed a commit to PattenR/mypy that referenced this pull request Jun 23, 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.
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.

2 participants