-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
Description
>>> type Invalid = dict[X, Y]
>>> Invalid[str, int]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Only generic type aliases are subscriptable
>>> Invalid.__value__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in Invalid
NameError: name 'X' is not defined
This seems correct to me.
However, this case is not covered right now with existing tests.
But, before adding a test case for this error (that in my opinion will be quite common among devs: when you forget to add [X, Y]
to type alias definition), I want to double check this with @JelleZijlstra