Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The compression documentation does not explain how a separately stored encoded length bounds parsing or how to derive that length when building. In particular,
Compressed(Bytes(10), "zlib")consumes the remaining compressed input and then reads ten decompressed bytes; it does not delimit ten bytes on the wire.This expands the API description and tunneling guide with an executable, symmetric example: parse through
FixedSized, build the compressed payload once, measure its stream positions, then usePointer/Rebuildto fill the earlier length. The example preserves a trailer, supports a nonzero starting offset, and explains the seekable-stream requirement and when to preferPrefixed. It uses existing constructs without changing their runtime behavior.Addresses #1123.
Validation: the example's 9 doctests and additional round-trip checks pass on Python 3.8 and 3.12, including changed payloads, empty and incompressible data, nonzero offsets, trailer boundaries, and one compression call per build. The full test suite passes (471 passed, 14 expected failures). Sphinx HTML renders the guide and API cross-reference; strict builds have the same 54 pre-existing warnings on the base and this branch.
AI-assisted documentation and validation.