Skip to content

Commit 0527f1d

Browse files
DaraanJelleZijlstra
andcommitted
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent 8184ac6 commit 0527f1d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/test_typing_extensions.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4148,6 +4148,17 @@ def test_total(self):
41484148
self.assertEqual(Options.__required_keys__, frozenset())
41494149
self.assertEqual(Options.__optional_keys__, {'log_level', 'log_path'})
41504150

4151+
def test_total_inherits_non_total(self):
4152+
class TD1(TypedDict, total=False):
4153+
a: int
4154+
4155+
self.assertIs(TD1.__total__, False)
4156+
4157+
class TD2(TD1):
4158+
b: str
4159+
4160+
self.assertIs(TD2.__total__, True)
4161+
41514162
def test_optional_keys(self):
41524163
class Point2Dor3D(Point2D, total=False):
41534164
z: int

0 commit comments

Comments
 (0)