This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brandtbucher
Recipients brandtbucher, gvanrossum, pbryan
Date 2020-12-07.18:12:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1607364728.28.0.0866836016003.issue42592@roundup.psfhosted.org>
In-reply-to
Content
It looks like the issue is that _TypedDictMeta only respects "total" as a keyword argument to __new__, but the TypedDict function passes it along by setting __total__ in the generated namespace instead.

This fixes it:

diff --git a/Lib/typing.py b/Lib/typing.py
index 46c54c4..bb0696b 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -2050,7 +2050,7 @@ class body be required.
     except (AttributeError, ValueError):
         pass
 
-    return _TypedDictMeta(typename, (), ns)
+    return _TypedDictMeta(typename, (), ns, total=total)
 
 _TypedDict = type.__new__(_TypedDictMeta, 'TypedDict', (), {})
 TypedDict.__mro_entries__ = lambda bases: (_TypedDict,)
History
Date User Action Args
2020-12-07 18:12:08brandtbuchersetrecipients: + brandtbucher, gvanrossum, pbryan
2020-12-07 18:12:08brandtbuchersetmessageid: <1607364728.28.0.0866836016003.issue42592@roundup.psfhosted.org>
2020-12-07 18:12:08brandtbucherlinkissue42592 messages
2020-12-07 18:12:07brandtbuchercreate