Closed MarcelWilson closed 1 year ago
The problem exists for any baseclass that annotates itself as the object returned by a method.
The easy solution to this would be to create TypeVar
s for each baseclass that would potentially be inherited.
See Mypy docs for more details about how TypeVar
is used.
PEP 673 was accepted and is included in 3.11 but mypy still hasn't merged the update to support checking it. I'm proposing we add TypeVar
now and when https://github.com/python/mypy/pull/11666 eventually releases I'll update the package to utilize Self
Thanks to @bandophahita's hard work, this issue has been resolved!
screenp-selenium has a
Pause
class that inherits screenpy.actions.pause.Pause.mypy will error on the following code from screenpy-selenium
"Pause" has not attribute "add_to_chain" [attr-defined]