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 commented on Jul 20, 2025
Bisects to #18943, cc @ilevkivskyi
ilevkivskyi commented on Jul 20, 2025
Note this is specific to typing.Self, the "old school" way (i.e. defining your own type variable and writing self: T) still works.
Fix decorated methods with self-types in protocols (python#19484)