Skip to content

improve codec encoded size API #4398

Open

Description

@d-v-b

we have 2 ways for a codec to report the size it encodes to:

  • the is_fixed_size attribute, which defaults to False. Really this should not be an attribute, and it should not default to False.
  • the compute_encoded_size method, which only returns int but if it returned None or a sentinel like UNKNOWN then it would completely replace the footgunny is_fixed_size attribute.

you can see where I'm going here. we should soft-deprecate is_fixed_size and widen the return type of compute_encoded_size, allowing that method to express that a particular codec doesn't emit a constant sized output.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions