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
{{ message }}
Repository navigation
False Positives in Protocol Assignability Check Where Self Is a Parameter of a Decorated Method (1.17.0) #19482
This is fine on both mypy 1.17.0 and 1.16.1. When we decorate foo in Proto (e.g., with @abstractmethod, @deprecated, or @classmethod), then the assignability check fails in mypy 1.17.0 only. Here are some snippets revealing the bug (the links use the master branch version because 1.17.0 is not available on mypy-play.net yet):
Activity
Pin mypy to 1.16.1
Pin mypy to 1.16.1
brianschubert commentedon Jul 20, 2025
Bisects to #18943, cc @ilevkivskyi
ilevkivskyi commentedon Jul 20, 2025
Note this is specific to
typing.Self, the "old school" way (i.e. defining your own type variable and writingself: T) still works.Fix decorated methods with self-types in protocols (python#19484)