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
Generic descriptors with a deprecated __get__ overload #18323
fromtypingimportAny, Generic, TypeVar, overloadfromtyping_extensionsimportdeprecatedT=TypeVar("T")
classWorks:
@overloaddef__get__(self, instance: None, objtype: Any) ->int: ...
@overload@deprecated("Accessing this attribute on the instance is deprecated",category=None, )def__get__(self, instance: 'Class', objtype: Any) ->int: ...
classFails(Generic[T]):
@overloaddef__get__(self, instance: None, objtype: Any) ->T: ...
@overload@deprecated("Accessing this attribute on the instance is deprecated",category=None, )def__get__(self, instance: 'Class', objtype: Any) ->T: ...
classClass:
works=Works()
fails=Fails[int]()
Class().worksClass().fails
$ mypy --enable-error-code=deprecated --disable-error-code=no-overload-impl repro.py
repro.py:86: error: overload def (self: repro.Works, instance: repro.Class, objtype: Any) -> builtins.int of functionrepro.Works.__get__ is deprecated: Accessing this attribute on the instance is deprecated [deprecated]
Activity
Viicos commentedon Sep 29, 2025
Fixed in 1.18.