Mar-19-2023, 07:26 AM
(Mar-18-2023, 11:24 PM)Skaperen Wrote: can it be thought of that there is a byte type but it is not available directly (limited to internal use)I don't think this is relevant for Python. Think of
bytes
objects as arrays of small integers which are coerced to ascii characters only when one converts the bytes
into a str
.>>> x = b'foo' >>> y = b'bar' >>> x[0] + 3 * y[2] 444 >>> print(x) b'foo' >>> list(x) [102, 111, 111] >>> bytes([102, 111, 111]) b'foo'