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

Multiple issues type checking AbstractEventLoop usage #17403

Closed
mbrancato opened this issue Jun 18, 2024 · 1 comment
Closed

Multiple issues type checking AbstractEventLoop usage #17403

mbrancato opened this issue Jun 18, 2024 · 1 comment
Labels
bug mypy got something wrong

Comments

@mbrancato
Copy link

Bug Report

In certain usages, mypy is producing many issues with the use of AbstractEventLoop types.

To Reproduce

https://mypy-play.net/?mypy=latest&python=3.12&gist=b362a24a92c45ef1b44ecc7bf6801296

Expected Behavior

I don't think there is typing issue with the linked code, and the code runs fine.

Actual Behavior

main.py:15: error: Incompatible types in assignment (expression has type "AbstractEventLoop", variable has type "type[AbstractEventLoop]")  [assignment]
main.py:20: error: Missing positional argument "self" in call to "close" of "AbstractEventLoop"  [call-arg]
main.py:24: error: Missing positional argument "self" in call to "is_closed" of "AbstractEventLoop"  [call-arg]
main.py:25: error: Incompatible types in assignment (expression has type "AbstractEventLoop", variable has type "type[AbstractEventLoop]")  [assignment]
main.py:27: error: Incompatible return value type (got "type[AbstractEventLoop]", expected "AbstractEventLoop")  [return-value]
main.py:30: error: Missing positional argument "future" in call to "run_until_complete" of "AbstractEventLoop"  [call-arg]
Found 6 errors in 1 file (checked 1 source file)

Your Environment

  • Mypy version used: 1.10
  • Mypy command-line flags:
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: 3.12, 3.11
@mbrancato mbrancato added the bug mypy got something wrong label Jun 18, 2024
@mbrancato
Copy link
Author

as soon as I opened this I realized the = instead of : in the variable definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

1 participant