We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9458120 commit c70e82eCopy full SHA for c70e82e
Lib/test/test_typing.py
@@ -5844,6 +5844,21 @@ class A:
5844
with self.assertRaises(TypeError):
5845
a[int]
5846
5847
+ def test_return_non_tuple_while_unpacking(self):
5848
+ # GH-138497: GenericAlias objects didn't ensure that __typing_subst__ actually
5849
+ # returned a tuple
5850
+ class Generic:
5851
+ def __call__(*_):
5852
+ return None
5853
+
5854
+ def __getattr__(self, _):
5855
+ return Generic()
5856
5857
+ evil = Generic()
5858
+ type type_alias[*_] = 0
5859
+ with self.assertRaises(TypeError):
5860
+ type_alias[evil][0]
5861
5862
5863
class ClassVarTests(BaseTestCase):
5864
0 commit comments