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
>>> type A[X] =list[X]
>>>dir(A[int])
[..., '__copy__', '__deepcopy__', ...]
We can access all other attributes, but not __copy__ and __deepcopy__:
>>> A[int].__copy__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>AttributeError: 'types.GenericAlias' object has no attribute '__copy__'. Did you mean: '__doc__'?
>>> A[int].__deepcopy__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>AttributeError: 'types.GenericAlias' object has no attribute '__deepcopy__'
I am not quite sure what is the right thing to do here 🤔
Repro:
We can access all other attributes, but not
__copy__and__deepcopy__:I am not quite sure what is the right thing to do here 🤔
Linked PRs
__dir__entries ofGenericAlias#138578__dir__entries ofGenericAlias(GH-138578) #138629__dir__entries ofGenericAlias(GH-138578) #138640