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 mypy to latest version and support mypy --strict #3927

Closed
AMDmi3 opened this issue Jul 22, 2019 · 1 comment
Closed

Update mypy to latest version and support mypy --strict #3927

AMDmi3 opened this issue Jul 22, 2019 · 1 comment

Comments

@AMDmi3
Copy link
Contributor

AMDmi3 commented Jul 22, 2019

Long story short

Following discussion in #3868, here's an issue to track a progress of cleaning up errors reported by newer mypy and/or mypy in strict mode.

Expected behaviour

aiohttp is clean with latest mypy (0.720 ATOW) in --strict mode.

Actual behaviour

There are some errors after updating mypy, and a lot of errors after enabling strict mode.

Steps to reproduce

Run mypy --strict aiohttp with latest mypy

Your environment

FreeBSD 12.0 amd64, python 3.7, mypy 0.720

@AMDmi3
Copy link
Contributor Author

AMDmi3 commented Jul 22, 2019

(I'll try to fix at least a part of this)

AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
- Add type annotations to global variables
- Fix handling of unused return values from time.gmtime
- Silence mypy error on return line (it's not yet capable of deducing
  that _cached_formatted_datetime is always defined at the end of the
  function)
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
(MatchObject.lastindex may be None)
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
    error: Incompatible types in "await" (actual type "Generator[Any, None, AbstractServer]", expected type "Awaitable[Any]")

Not sure how to fix, may be a typeshed problem
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
Not sure how to fix this properly, the logic is hard to follow
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
- Don't reuse variable to decomplicate logic
- Silence error at return line as mypy cannot deduce that result
  cannot be Awaitable after the 'if'
@AMDmi3 AMDmi3 mentioned this issue Jul 22, 2019
5 tasks
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
    error: Incompatible types in "await" (actual type "Generator[Any, None, AbstractServer]", expected type "Awaitable[Any]")

Not sure how to fix, may be a typeshed problem
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
Not sure how to fix this properly, the logic is hard to follow
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Jul 22, 2019
- Don't reuse variable to decomplicate logic
- Silence error at return line as mypy cannot deduce that result
  cannot be Awaitable after the 'if'
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 1, 2019
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 1, 2019
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 1, 2019
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 1, 2019
- Add type annotations to global variables
- Fix handling of unused return values from time.gmtime
- Silence mypy error on return line (it's not yet capable of deducing
  that _cached_formatted_datetime is always defined at the end of the
  function)
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 1, 2019
(MatchObject.lastindex may be None)
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 1, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 1, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 1, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 1, 2019
    error: Incompatible types in "await" (actual type "Generator[Any, None, AbstractServer]", expected type "Awaitable[Any]")

Not sure how to fix, may be a typeshed problem
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 1, 2019
Not sure how to fix this properly, the logic is hard to follow
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
- Add type annotations to global variables
- Fix handling of unused return values from time.gmtime
- Silence mypy error on return line (it's not yet capable of deducing
  that _cached_formatted_datetime is always defined at the end of the
  function)
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
(MatchObject.lastindex may be None)
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
    error: Incompatible types in "await" (actual type "Generator[Any, None, AbstractServer]", expected type "Awaitable[Any]")

Not sure how to fix, may be a typeshed problem
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
Not sure how to fix this properly, the logic is hard to follow
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
    error: Incompatible types in "await" (actual type "Generator[Any, None, AbstractServer]", expected type "Awaitable[Any]")

Not sure how to fix, may be a typeshed problem
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
Not sure how to fix this properly, the logic is hard to follow
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
...by moving field type annotation to class definition
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
    error: Incompatible types in "await" (actual type "Generator[Any, None, AbstractServer]", expected type "Awaitable[Any]")

Not sure how to fix, may be a typeshed problem
AMDmi3 added a commit to AMDmi3/aiohttp that referenced this issue Aug 13, 2019
Not sure how to fix this properly, the logic is hard to follow
@derlih derlih mentioned this issue Dec 24, 2020
5 tasks
@derlih derlih closed this as completed Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants