You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is slightly related to #124445, but a different issue, maybe it can be solved at the same time?
Consider the following code where [T] is a parameters_expression according to PEP 612. Similar to using Callable or using Generic[P] or Protocol[P] I would expect the following code to work and receive a hashable variable:
The problem is that X[[T]].__args__ == ([T],) which cannot be hashed. I think the list should either be turned into a tuple. Either a nested one as its done for Generic and Protocol or joined like for Callable[P, str][[int]].__args__.
Bug report
Bug description:
This is slightly related to #124445, but a different issue, maybe it can be solved at the same time?
Consider the following code where
[T]
is a parameters_expression according to PEP 612. Similar to usingCallable
or usingGeneric[P]
orProtocol[P]
I would expect the following code to work and receive a hashable variable:Cause:
The problem is that
X[[T]].__args__ == ([T],)
which cannot be hashed. I think the list should either be turned into a tuple. Either a nested one as its done forGeneric
andProtocol
or joined like forCallable[P, str][[int]].__args__
.Discussion:
I've opened a parallel topic on discuss
CPython versions tested on:
3.13.0.rc2
Operating systems tested on:
Linux
EDIT: A thought, should this be changed for whole class in general?
The text was updated successfully, but these errors were encountered: