Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update typehints to allow usage of latest mypy version #4

Open
3 tasks
max-k opened this issue Dec 16, 2020 · 1 comment
Open
3 tasks

Update typehints to allow usage of latest mypy version #4

max-k opened this issue Dec 16, 2020 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@max-k
Copy link

max-k commented Dec 16, 2020

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.

@taybin
Copy link

taybin commented Aug 7, 2021

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

@wbarnha wbarnha added help wanted Extra attention is needed bug Something isn't working labels Nov 18, 2022
@lqhuang lqhuang added good first issue Good for newcomers and removed bug Something isn't working labels Dec 15, 2022
@wbarnha wbarnha removed the good first issue Good for newcomers label Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants