8000 bpo-46445: cover multiple inheritance of `TypedDict` in `test_typing` by sobolevn · Pull Request #30719 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-46445: cover multiple inheritance of TypedDict in test_typing #30719

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 3 commits into from
Jan 21, 2022
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
Address review
  • Loading branch information
sobolevn committed Jan 21, 2022
commit bcc867c87d1d6788b102c650f0efa56fe1110642
15 changes: 15 additions & 0 deletions Lib/test/test_typing.py
8000
Original file line number Diff line number Diff line change
Expand Up @@ -4433,6 +4433,21 @@ class ChildWithOptional(One, Untotal):
{'one': int, 'untotal': str, 'child': bool},
)

class ChildWithTotalFalse(One, Untotal, total=False):
child: bool
self.assertEqual(
ChildWithTotalFalse.__required_keys__,
frozenset(['one']),
)
self.assertEqual(
ChildWithTotalFalse.__optional_keys__,
frozenset(['untotal', 'child']),
)
self.assertEqual(
ChildWithTotalFalse.__annotations__,
{'one': int, 'untotal': str, 'child': bool},
)

class ChildWithInlineAndOptional(Untotal, Inline):
child: bool
self.assertEqual(
Expand Down
0