We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 89d8b2d commit d8ce092Copy full SHA for d8ce092
Lib/test/test_typing.py
@@ -8479,6 +8479,22 @@ class TD2(TD1):
8479
8480
self.assertIs(TD2.__total__, True)
8481
8482
+ def test_total_with_assigned_value(self):
8483
+ class TD(TypedDict):
8484
+ __total__ = "some_value"
8485
+
8486
+ self.assertIs(TD.__total__, True)
8487
8488
+ class TD2(TypedDict, total=True):
8489
8490
8491
+ self.assertIs(TD2.__total__, True)
8492
8493
+ class TD3(TypedDict, total=False):
8494
+ __total__ = "some value"
8495
8496
+ self.assertIs(TD3.__total__, False)
8497
8498
def test_optional_keys(self):
8499
class Point2Dor3D(Point2D, total=False):
8500
z: int
0 commit comments