mirror of
https://github.com/python/cpython.git
synced 2025-07-28 13:44:43 +00:00
[3.9] bpo-45662: Fix the repr of InitVar with a type alias to the built-in class (GH-29291) (GH-29924)
For example, InitVar[list[int]].
(cherry picked from commit 1fd4de5bdd
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
5ae4265b8c
commit
fb8aad1640
3 changed files with 5 additions and 1 deletions
|
@ -1125,6 +1125,8 @@ class TestCase(unittest.TestCase):
|
|||
self.assertEqual(repr(InitVar[int]), 'dataclasses.InitVar[int]')
|
||||
self.assertEqual(repr(InitVar[List[int]]),
|
||||
'dataclasses.InitVar[typing.List[int]]')
|
||||
self.assertEqual(repr(InitVar[list[int]]),
|
||||
'dataclasses.InitVar[list[int]]')
|
||||
|
||||
def test_init_var_inheritance(self):
|
||||
# Note that this deliberately tests that a dataclass need not
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue