- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3k
Open
Labels
bugmypy got something wrongmypy got something wrongtopic-pep-702PEP 702, @deprecatedPEP 702, @deprecated
Description
Bug Report, To Reproduce, & Actual Behaviour
This is similar to #19588, but that was fixed on master for the case when __init__ is overloaded.
In the non-overloaded case, @deprecated still doesn't report anything (mypy Playground):
To Reproduce
from typing import overload
from typing_extensions import deprecated, Self
class Some:
    @deprecated("reason")
    def __new__(cls, x: str) -> Self: ...
Some('test')  # No reports here
class Some2:
    @deprecated("reason")
    def __init__(self, x: str) -> None: ...
Some2('test')  # No reports hereExpected Behavior
Some('test')  # E: function Some.__new__ is deprecated: reason  [deprecated]
Some2('test')  # E: function Some.__init__ is deprecated: reason  [deprecated]Your Environment
- Mypy version used: 1.18.2, master
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-pep-702PEP 702, @deprecatedPEP 702, @deprecated