Message382666
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,) |
|
Date |
User |
Action |
Args |
2020-12-07 18:12:08 | brandtbucher | set | recipients:
+ brandtbucher, gvanrossum, pbryan |
2020-12-07 18:12:08 | brandtbucher | set | messageid: <1607364728.28.0.0866836016003.issue42592@roundup.psfhosted.org> |
2020-12-07 18:12:08 | brandtbucher | link | issue42592 messages |
2020-12-07 18:12:07 | brandtbucher | create | |
|