bpo-38431: Fix __repr__ method of InitVar to work with typing objects. (GH-16702)
(cherry picked from commit 793cb85437299a3da3d74fe65480d720af330cbb)
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py
index 0885c97..b018133 100755
--- a/Lib/test/test_dataclasses.py
+++ b/Lib/test/test_dataclasses.py
@@ -1102,6 +1102,8 @@
# Make sure the repr is correct.
self.assertEqual(repr(InitVar[int]), 'dataclasses.InitVar[int]')
+ self.assertEqual(repr(InitVar[List[int]]),
+ 'dataclasses.InitVar[typing.List[int]]')
def test_init_var_inheritance(self):
# Note that this deliberately tests that a dataclass need not