Using Python REPL as a bit/byte-aware calculator is weird sometimes.

>>> b'A' == 0x41
False
>>> b'A' == [0x41]
False
>>> int(b'A', 16)
10
>>> bytes(0x41)
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
>>> bytes([0x41])
b'A'
>>> b'A' == bytes([0x41])
True
@colt Right, I tend to avoid escapes in strings though, it usually gets weird for values greater than 0x7F as that's outside of ASCII.
Inscrivez-vous pour prendre part à la conversation
nanao

Comme le soleil, les machines ne se couchent jamais.