Skip to content

Commit 46b6fa3

Browse files
Update Lib/test/test_typing.py
Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 761812d commit 46b6fa3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Lib/test/test_typing.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5847,14 +5847,14 @@ class A:
58475847
def test_return_non_tuple_while_unpacking(self):
58485848
# GH-138497: GenericAlias objects didn't ensure that __typing_subst__ actually
58495849
# returned a tuple
5850-
class Generic:
5851-
def __call__(*_):
5852-
return None
5853-
5854-
def __getattr__(self, _):
5855-
return Generic()
5856-
5857-
evil = Generic()
5850+
class EvilTypeVar:
5851+
__typing_is_unpacked_typevartuple__ = True
5852+
def __typing_prepare_subst__(*_):
5853+
return None # any value
5854+
def __typing_subst__(*_):
5855+
return 42 # not tuple
5856+
5857+
evil = EvilTypeVar()
58585858
type type_alias[*_] = 0
58595859
with self.assertRaises(TypeError):
58605860
type_alias[evil][0]

0 commit comments

Comments
 (0)