Skip to content

Primitives for common bytes operations #880

Open
@JukkaL

Description

@JukkaL

These operations related to bytes values are either common or "fundamental" and worth dedicated primitives if they help with performance:

These operations in six are also quite common in many codebases:

  • ensure_str
  • ensure_binary

These are somewhat common and fairly easy to implement:

  • b.startswith(...)
  • b.endswith(...)
  • b.lower()
  • b.upper()
  • b.strip()

Maybe also support these (fundamental but not very common operations):

  • bytes([n]) (corresponds to chr(x))
  • ord(b)
  • b * n

This is part of the wider issue #644.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions