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
I stumbled across this while reviewing #294, and it took me ages to figure out what I was doing wrong:
>>> import typing_extensions as t
>>> @t.deprecated
... classFoo: ...
...
>>> classBar(Foo): pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: function() argument 'code' must be code, not str
The issue, of course, is that you're meant to pass a deprecation message to @deprecated, e.g.:
importtyping_extensionsast@t.deprecated('Foo will go away soon')classFoo: ...