10000 Support TypedDicts with missing keys (total=False) by JukkaL · Pull Request #3558 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Support TypedDicts with missing keys (total=False) #3558

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

Merged
merged 20 commits into from
Jun 23, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix lint
  • Loading branch information
JukkaL committed Jun 19, 2017
commit 4429ce14c51296390b55e5c72770ad3fade016ca
8 changes: 4 additions & 4 deletions mypy/test/testextensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def test_typeddict_errors(self):
def test_py36_class_syntax_usage(self):
self.assertEqual(LabelPoint2D.__annotations__, {'x': int, 'y': int, 'label': str}) # noqa
self.assertEqual(LabelPoint2D.__bases__, (dict,)) # noqa
self.assertEqual(LabelPoint2D.__total__, True)
self.assertEqual(LabelPoint2D.__total__, True) # noqa
self.assertNotIsSubclass(LabelPoint2D, typing.Sequence) # noqa
not_origin = Point2D(x=0, y=1) # noqa
self.assertEqual(not_origin['x'], 0)
Expand Down Expand Up @@ -134,9 +134,9 @@ def test_total(self):
self.assertEqual(D.__total__, False)

if PY36:
self.assertEqual(Options(), {})
self.assertEqual(Options(log_level=2), {'log_level': 2})
self.assertEqual(Options.__total__, False)
self.assertEqual(Options(), {}) # noqa
self.assertEqual(Options(log_level=2), {'log_level': 2}) # noqa
self.assertEqual(Options.__total__, False) # noqa


if __name__ == '__main__':
Expand Down
0