mode icon indicating copy to clipboard operation
mode copied to clipboard

Update typehints to allow usage of latest mypy version

Open max-k opened this issue 5 years ago • 1 comments

Checklist

  • [ ] I have updated signatures to match parents classes
  • [ ] I have sucessfuly run mypy 0.790 using mypy -m mode
  • [ ] I have updated requirements/typecheck.txt to remove mention to explicit mypy version

Steps to reproduce

Using latest mypy version, typehint checks are broken

Expected behavior

$ mypy -p mode
Success: no issues found in 46 source files

Actual behavior

$ mypy -p mode
mode/locals.py: note: In member "throw" of class "CoroutineRole":
mode/locals.py:424:5: error: Signature of "throw" incompatible with supertype "Coroutine"  [override]
        def throw(self,
        ^
mode/locals.py: note: In member "athrow" of class "AsyncGeneratorRole":
mode/locals.py:487:5: error: Signature of "athrow" incompatible with supertype "AsyncGenerator"  [override]
        def athrow(self,
        ^
mode/locals.py: note: In member "index" of class "SequenceRole":
mode/locals.py:523:5: error: Signature of "index" incompatible with supertype "Sequence"  [override]
        def index(self, x: Any, *args: Any, **kwargs: Any) -> int:
        ^
mode/utils/imports.py: note: In member "by_url" of class "FactoryMapping":
mode/utils/imports.py:98:5: error: Argument 2 to "by_url" becomes "Union[str, Any]" due to an unfollowed import  [no-any-unimported]
        def by_url(self, url: Union[str, URL]) -> _T:
        ^
Found 4 errors in 2 files (checked 46 source files)

Versions

  • Python 3.9
  • Mode 0.1.0
  • Mypy 0.790

Additional informations

Typehints of parent classes can be found in typeshed github project.

max-k avatar Dec 16 '20 13:12 max-k

I looked into this. It's some deep voodoo, afict. :(

taybin avatar Aug 07 '21 00:08 taybin