Docs: Add bz2 usage examples#13258
Conversation
9b80808 to
2738234
Compare
pitrou
left a comment
There was a problem hiding this comment.
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
compresslevelanddata:compresslevelmust be anint, not any number. Forinstance, passing a float will raise
TypeErrordatamust be bytes-like