Skip to content

Add empty() growable-buffer initializer for Python encoders#191

Merged
UeliDeSchwert merged 1 commit into
developfrom
ms/codec-empty-initializer
Jul 16, 2026
Merged

Add empty() growable-buffer initializer for Python encoders#191
UeliDeSchwert merged 1 commit into
developfrom
ms/codec-empty-initializer

Conversation

@UeliDeSchwert

Copy link
Copy Markdown
Collaborator

Add an empty() classmethod to the Python runtime encoders (UPEREncoder, ACNEncoder via the Encoder base, and XEREncoder) for creating an encoder when the output size is not known in advance, without a size estimate.

BitStream gains an opt-in growable flag: write operations that would exceed the buffer grow it (amortised doubling) instead of raising. The flag defaults to False, so of_size()/from_buffer() buffers and decoders keep their bounded semantics. This brings the runtime in line with the MBEP TN-3 user manual, which already documents empty() as the recommended encoder initializer.

Add an empty() classmethod to the Python runtime encoders (UPEREncoder,
ACNEncoder via the Encoder base, and XEREncoder) for creating an encoder
when the output size is not known in advance, without a size estimate.

BitStream gains an opt-in growable flag: write operations that would
exceed the buffer grow it (amortised doubling) instead of raising. The
flag defaults to False, so of_size()/from_buffer() buffers and decoders
keep their bounded semantics. This brings the runtime in line with the
MBEP TN-3 user manual, which already documents empty() as the
recommended encoder initializer.
@UeliDeSchwert
UeliDeSchwert merged commit def914f into develop Jul 16, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant