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

Allow memoryview[bytes] in write() and writelines() #13519

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Dreamsorcerer
Copy link
Contributor

We have tests on aiohttp which end up passing memoryview[bytes] to these methods and they seem to work. With mypy's --strict-bytes it gives a type error due to the missing type in typeshed.

@Dreamsorcerer
Copy link
Contributor Author

pytype refuses to allow specifying the type parameter...

This comment has been minimized.

@JelleZijlstra
Copy link
Member

Should this be ReadableBuffer instead?

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@Dreamsorcerer
Copy link
Contributor Author

Should this be ReadableBuffer instead?

Seems to work, but as python-chess highlights, it will require any subclasses to update their annotations.

Copy link
Contributor

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

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