Playground: https://mypy-play.net/?mypy=latest&python=3.12&gist=6ae94d19a2160b47cd3c3f2f0bc96553
This code does not produce a [deprecated] error:
# mypy: enable-error-code = deprecatedfromtypingimportoverloadfromtyping_extensionsimportdeprecatedclassSome:
@overload@deprecated("reason2")defsome(self) ->None: ...
@overloaddefsome(self, x: int) ->None: ...
Some().some() # no error here!However, this one does:
@overload@deprecated("reason1")deffunc() ->None: ...
@overloaddeffunc(x: int) ->None: ...
func() # E: overload def () of function __main__.func is deprecated: reason1Version:
» mypy --version
mypy 1.15.0+dev.c9ed867352b0be6b2cca9df3c856f9047409751b (compiled: no)
Playground: https://mypy-play.net/?mypy=latest&python=3.12&gist=6ae94d19a2160b47cd3c3f2f0bc96553
This code does not produce a
[deprecated]error:However, this one does:
Version: