typing.Self
does not work properly with class variables
#16410
Labels
typing.Self
does not work properly with class variables
#16410
Bug Report
typing.Self
does not work well with class variables.To Reproduce
In Python 3.11, write and execute the same code from here, which is
Expected Behavior
There should be no error.
Actual Behavior
Mypy reports
Incompatible return value type (got "Team", expected "Self")
onreturn cls._cache[name]
.Your Environment
mypy (filename)
mypy.ini
(and other config files): NothingThe text was updated successfully, but these errors were encountered: