bpo-42059: Fixed required/optional keys with old-style TypedDict#22736
Conversation
There was a problem hiding this comment.
Thanks for your patience, and for taking the time to fix this @agronholm!
This looks good; I just have have some suggestions to clarify the NEWS entry a bit:
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
Note to self: the 3.8 backport will need to be done manually, since |
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
Thanks! @ambv, am I correct in assuming that the 3.8 backport should not be merged until 3.8.7 is released in ~2 weeks? |
|
Thanks @agronholm for the PR, and @brandtbucher for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
|
Hm, looks like the bot is stuck. I'm going to try removing and re-adding the backport labels. |
|
Thanks @agronholm for the PR, and @brandtbucher for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
|
Thanks @agronholm for the PR, and @brandtbucher for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
|
Thanks @agronholm for the PR, and @brandtbucher for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
|
Thanks @agronholm for the PR, and @brandtbucher for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
|
GH-23747 is a backport of this pull request to the 3.9 branch. |
…pythonGH-22736) (cherry picked from commit 67b769f) Co-authored-by: Alex Grönholm <alex.gronholm@nextday.fi>
|
Thanks @agronholm for the PR, and @brandtbucher for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
|
Sorry, @agronholm and @brandtbucher, I could not cleanly backport this to |
|
🤦🏼 It looks like |
On Python 3.9.0 and Python 3.9.1, `typing.TypedDict` does not correctly hold the `__required_keys__` and `__optional_keys__` attributes, the fix (python/cpython#22736) for this issue was merged on 10/12/2020 and Python 3.9.1 was released on 8/12/2020, as such, the minimum Python version that does not require the use of `typing-extensions` is Python 3.9.2 However, writing our imports this way breaks mypy, reporting 1651 errors :)
The
TypedDict()function now passes the value oftotalas a metaclass argument instead of putting it directly in the attribute namespace.https://bugs.python.org/issue42059