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

Fix loop.remove_reader() and loop.remove_writer() signatures #7042

Merged
merged 2 commits into from
Jan 26, 2022

Conversation

asvetlov
Copy link
Contributor

These methods return True if reader/writer was previously set, False otherwise.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau
Copy link
Collaborator

srittau commented Jan 26, 2022

We should also change the return type in AbstractEventLoop.

@asvetlov
Copy link
Contributor Author

Correct, thanks. Fixed.

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

tornado (https://github.com/tornadoweb/tornado)
+ tornado/platform/asyncio.py:641: error: Return type "None" of "remove_reader" incompatible with return type "bool" in supertype "AbstractEventLoop"
+ tornado/platform/asyncio.py:645: error: Return type "None" of "remove_writer" incompatible with return type "bool" in supertype "AbstractEventLoop"

@asvetlov
Copy link
Contributor Author

asvetlov commented Jan 26, 2022

Tornado is slightly incompatible with the reference asyncio implementation, sorry.
The boolean was returned from these methods starting from the very first asyncio release, please trust me :)

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.

2 participants