Skip to content

Commit 0c9ef48

Browse files
committed
1 parent 00e8ee7 commit 0c9ef48

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/test_typing_extensions.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4159,6 +4159,22 @@ class TD2(TD1):
41594159

41604160
self.assertIs(TD2.__total__, True)
41614161

4162+
def test_total_with_assigned_value(self):
4163+
class TD(TypedDict):
4164+
__total__ = "some_value"
4165+
4166+
self.assertIs(TD.__total__, True)
4167+
4168+
class TD2(TypedDict, total=True):
4169+
__total__ = "some_value"
4170+
4171+
self.assertIs(TD2.__total__, True)
4172+
4173+
class TD3(TypedDict, total=False):
4174+
__total__ = "some value"
4175+
4176+
self.assertIs(TD3.__total__, False)
4177+
41624178
def test_optional_keys(self):
41634179
class Point2Dor3D(Point2D, total=False):
41644180
z: int

0 commit comments

Comments
 (0)