-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
python-gitlab/python-gitlab
#3122Labels
bugmypy got something wrongmypy got something wrongtopic-overloadstopic-pep-702PEP 702, @deprecatedPEP 702, @deprecated
Description
Playground: https://mypy-play.net/?mypy=latest&python=3.12&gist=6ae94d19a2160b47cd3c3f2f0bc96553
This code does not produce a [deprecated]
error:
# mypy: enable-error-code = deprecated
from typing import overload
from typing_extensions import deprecated
class Some:
@overload
@deprecated("reason2")
def some(self) -> None: ...
@overload
def some(self, x: int) -> None: ...
Some().some() # no error here!
However, this one does:
@overload
@deprecated("reason1")
def func() -> None: ...
@overload
def func(x: int) -> None: ...
func() # E: overload def () of function __main__.func is deprecated: reason1
Version:
» mypy --version
mypy 1.15.0+dev.c9ed867352b0be6b2cca9df3c856f9047409751b (compiled: no)
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-overloadstopic-pep-702PEP 702, @deprecatedPEP 702, @deprecated