-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Maybe use bytearray in general (to replace int lists)
- mutable alternative to
bytes, similar functionality as int list - readable since is explicitly holding byte values and has related features, and for that reason also maps to other languages better (understandable example code; other languages have string features related to byte collections as well)
extend(ba: bytearray)append(b: int)# no cast necessary- elements read as if it were
list[int], but it has decode method likebytes
- elements read as if it were
- can cast directly from
list[int]orbytes - cast cast directly to
bytes
- conversion is more direct (
bytes(data[:byteCount]).decode("utf-8")orbytearray(data[:byteCount]).decode("utf-8")becomesdata[:byteCount].decode("utf-8"))- slightly faster probably, or at least less code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels