-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
3.14: PEP-784 compression except zstd #13992
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
Conversation
This comment has been minimized.
This comment has been minimized.
27b8b34
to
06181bc
Compare
This comment has been minimized.
This comment has been minimized.
06181bc
to
e728c53
Compare
This comment has been minimized.
This comment has been minimized.
562bf17
to
24dafa3
Compare
This comment has been minimized.
This comment has been minimized.
There's a (small) merge conflict now due to allowlist changes. One request: Please don't force push here as that makes reviewing harder. We squash on merge anyway. |
Conflict should be resolved now. Sorry for the force-pushes earlier, I thought it was ok while the PR had the draft status. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, a few remarks below.
@@ -0,0 +1,25 @@ | |||
from _typeshed import WriteableBuffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from _typeshed import WriteableBuffer | |
from _typeshed import Incomplete, WriteableBuffer |
See below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just copied that file from _compression.pyi
without any changes, should I make the requested changes on _compression.pyi
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be great, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be done now!
Do you have any thoughts on the code duplication between the two? Like a way to remove the duplication, or if I should add a comment on both files telling that the other should probably be updated at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would make sense to add a comment to the top of _compression.pyi
to copy all changes to compression.*
. I don't think the reverse direction is as important (and often the changes won't apply to older Python versions anyway.) Maybe add a comment to DecompressReader.decomp_factory
in case someone actually adds a proper return type at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the two comments, hopefully the wording is ok
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
First PR about PEP-784 in sdlib:
bz2
/gzip
/lzma
/zlib
incompression.*
_compression
intocompression._common._streams
, and re-export the latter from the formerstubtest_allowlists
for 3.14 accordingly (the additions are copied that already exists in the non-compression
modules)For the last point, I did not find a better way than copying the file, because only one of the two modules exist depending on Python version (so cannot import from the other)▶️ feel free to suggest a better idea! (or tell if I should add a comment about that somewhere)
Adding
compression.zstd
will be done in a distinct PR.