We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27a28ee commit 78b0da8Copy full SHA for 78b0da8
Lib/test/test_typing.py
@@ -8356,6 +8356,22 @@ class TD2(TD1):
8356
8357
self.assertIs(TD2.__total__, True)
8358
8359
+ def test_total_with_assigned_value(self):
8360
+ class TD(TypedDict):
8361
+ __total__ = "some_value"
8362
+
8363
+ self.assertIs(TD.__total__, True)
8364
8365
+ class TD2(TypedDict, total=True):
8366
8367
8368
+ self.assertIs(TD2.__total__, True)
8369
8370
+ class TD3(TypedDict, total=False):
8371
+ __total__ = "some value"
8372
8373
+ self.assertIs(TD3.__total__, False)
8374
8375
def test_optional_keys(self):
8376
class Point2Dor3D(Point2D, total=False):
8377
z: int
0 commit comments