You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 like bytes
can cast directly from list[int] or bytes
cast cast directly to bytes
conversion is more direct (bytes(data[:byteCount]).decode("utf-8") or bytearray(data[:byteCount]).decode("utf-8") becomes data[:byteCount].decode("utf-8"))
slightly faster probably, or at least less code
The text was updated successfully, but these errors were encountered:
Maybe use
bytearray
in general (to replace int lists)bytes
, similar functionality as int listextend(ba: bytearray)
append(b: int)
# no cast necessarylist[int]
, but it has decode method likebytes
list[int]
orbytes
bytes
bytes(data[:byteCount]).decode("utf-8")
orbytearray(data[:byteCount]).decode("utf-8")
becomesdata[:byteCount].decode("utf-8")
)The text was updated successfully, but these errors were encountered: