From a0184e588f981d9023a560e5d2d1941e7c4f09e7 Mon Sep 17 00:00:00 2001 From: Emma Harper Smith Date: Thu, 29 May 2025 19:06:07 -0700 Subject: [PATCH 1/2] Document CompressionParameter.content_size_flag --- Doc/library/compression.zstd.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Doc/library/compression.zstd.rst b/Doc/library/compression.zstd.rst index 1e1802155a19ec..1cdc6c10bfa4ee 100644 --- a/Doc/library/compression.zstd.rst +++ b/Doc/library/compression.zstd.rst @@ -615,6 +615,24 @@ Advanced parameter control A value of zero causes the value to be selected automatically. + .. attribute:: content_size_flag + + Write the size of the data to be compressed into the Zstandard frame + header when known prior to compressing. + + This flag only takes effect under the following two scenarios: + + * Calling :func:`compress` for one-shot compression + * Providing all of the data to be compressed in the frame in a single + :meth:`ZstdCompressor.compress` call, with the + :attr:`ZstdCompressor.FLUSH_FRAME` mode. + + All other compression calls may not write the size information into the + frame header. + + ``True`` or ``1`` enable the content size flag while ``False`` or ``0`` + disable it. + .. attribute:: checksum_flag A four-byte checksum using XXHash64 of the uncompressed content is From aeecf4edd7d8f01630a771f95e686c1b0f54b8d2 Mon Sep 17 00:00:00 2001 From: Emma Harper Smith Date: Thu, 29 May 2025 19:44:00 -0700 Subject: [PATCH 2/2] Remove spurrious whitespace --- Doc/library/compression.zstd.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/compression.zstd.rst b/Doc/library/compression.zstd.rst index 1cdc6c10bfa4ee..35bcbc2bfd8eac 100644 --- a/Doc/library/compression.zstd.rst +++ b/Doc/library/compression.zstd.rst @@ -621,7 +621,7 @@ Advanced parameter control header when known prior to compressing. This flag only takes effect under the following two scenarios: - + * Calling :func:`compress` for one-shot compression * Providing all of the data to be compressed in the frame in a single :meth:`ZstdCompressor.compress` call, with the