-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
pytype refuses to allow specifying the type parameter... |
This comment has been minimized.
This comment has been minimized.
Should this be ReadableBuffer instead? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Seems to work, but as python-chess highlights, it will require any subclasses to update their annotations. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Sebastian Rittau <[email protected]>
I'm still unsure what problem pytype has. I'm also not sure whom to ping about this nowadays. Adding the two changes files to tests/pytype_exclude_list.txt might help. |
This comment has been minimized.
This comment has been minimized.
Diff from mypy_primer, showing the effect of this PR on open source code: aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/http_writer.py:101: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/http_writer.py:120: error: Unused "type: ignore" comment [unused-ignore]
|
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.