-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
Docs: Add bz2 usage examples #13258
Docs: Add bz2 usage examples #13258
Conversation
9b80808
to
2738234
Compare
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.
LGTM generally. I'll let someone else review the grammar.
- Adds an "Examples of usage" section inspired by the one found in the gzip docs - Corrects the descriptions for ``compresslevel`` and ``data``: - ``compresslevel`` must be an `int`, not any number. For instance, passing a float will raise ``TypeError`` - Notes that `data` must be bytes-like
2738234
to
25bce3d
Compare
i made an edit that I believe will fix the failing doctest. otherwise this looks good to me. waiting on CI now. as this is just a documentation improvement, no issue or news entry necessary. |
Thanks for having a look @gpshead - two thoughts/questions:
Also:
|
It was in the wrong place as btw, i removed the extra ``s. i just obey whatever sphinx says for this sort of thing. |
This modifies the compression ratio by a hair.
heh, true. compressing random data is rather pointless. how about just changing that to yield something else. Even if it just yields chunks of |
Compressing random data (low compression ratio) is a less realistic and less useful example.
Thanks @bsolomon1124 for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
* Docs: Add bz2 usage examples - Adds an "Examples of usage" section inspired by the one found in the gzip docs - Corrects the descriptions for ``compresslevel`` and ``data``: - ``compresslevel`` must be an `int`, not any number. For instance, passing a float will raise ``TypeError`` - Notes that `data` must be bytes-like (cherry picked from commit be6939f) Co-authored-by: Brad <brad.solomon.1124@gmail.com>
GH-13294 is a backport of this pull request to the 3.7 branch. |
Thanks for the documentation improvement, always appreciated! |
@gpshead appreciate your guidance. It was a positive experience as my first CPython PR. |
* Docs: Add bz2 usage examples - Adds an "Examples of usage" section inspired by the one found in the gzip docs - Corrects the descriptions for ``compresslevel`` and ``data``: - ``compresslevel`` must be an `int`, not any number. For instance, passing a float will raise ``TypeError`` - Notes that `data` must be bytes-like (cherry picked from commit be6939f) Co-authored-by: Brad <brad.solomon.1124@gmail.com>
found in the gzip docs
compresslevel
anddata
:compresslevel
must be anint
, not any number. Forinstance, passing a float will raise
TypeError
data
must be bytes-like