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

Replace BaseEventLoop with AbstractEventLoop #16

Merged

Conversation

freundTech
Copy link
Contributor

This is needed for the type annotations to work correctly with type-checkers.

asyncio.get_event_loop(), asyncio.get_running_loop() and similar functions all return AbstractEventLoop, leading to a type error if one tries to pass their return value to this library.

See https://github.com/python/typeshed/blob/master/stdlib/asyncio/events.pyi#L527

@horazont
Copy link
Owner

@freundTech Hi! Thanks for the PR - I completely missed the notification though.

Before we go further, could you please include your PR description (as 72-char wide line-wrapped text) in the commit message? That would be most appreciated in order to have all necessary context for a change easily reachable from git log.

Thanks!

@freundTech freundTech force-pushed the fix-abstract-event-loop-annotation branch from 9992a30 to 328d3bc Compare May 16, 2022 17:29
@freundTech
Copy link
Contributor Author

Done! I also replace the link to typeshed, as the line numbers had changed. I've now linked to a fixed revision.

@horazont
Copy link
Owner

@freundTech Thanks! Now I can even trigger the pipeline run \o/. Could you maybe add the line wrapping to the commit message and leave blanks between the paragraphs?

This is needed for the type annotations to work correctly with
type-checkers.

asyncio.get_event_loop(), asyncio.get_running_loop() and similar
functions all return AbstractEventLoop, leading to a type error if one
tries to pass their return value to this library.

See https://github.com/python/typeshed/blob/97a74bc1aab4b18827a8861dfc310c96cc52ad55/stdlib/asyncio/events.pyi#L590
@freundTech freundTech force-pushed the fix-abstract-event-loop-annotation branch from 328d3bc to 5dbff84 Compare May 16, 2022 17:39
@freundTech
Copy link
Contributor Author

I updated the commit message again and fixed the mypy and lint errors (mypy was complaining about an unused # type: ignore and flake8 about a line to long in inline documentation)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 67.285% when pulling 5dbff84 on freundTech:fix-abstract-event-loop-annotation into 4726f00 on horazont:devel.

@horazont
Copy link
Owner

Thanks a lot!

@horazont horazont merged commit 8f250c0 into horazont:devel May 17, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants