google / google/brotli

decompressor should have an attribute to tell if output is available

Open
#1,448 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
14.9k
Forks
1.4k
Avg merge
4d 20h
Merged PRs (30d)
9

Description

The current API when using max_output_length feels inadequate, as there is no way to know if there is more data available to decompress or not. Users must make a redundant call to .decompress() and receive an empty repsonse to know that all pending data has been decompressed.

My suggestion would be to have a simple .data_available attribute that represents this. Or, to match the zstd API (among others), a .needs_input attribute could be added, in which case a user can check `not d.needs_input and not d.is_finished()`.

I'm interested in the Python API here, not sure how relevant to others.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.