Say, I've a byte string, e.g.:
bs: bytes = b'\xaf]\x95Q\x0b'
Now, take out the string part by copy and paste and assign it to a string variable:
s: string = "\xaf]\x95Q\x0b"
How do I convert s
, say with a function cnv(s: str) -> bytes
, back to bytes so the expression bs == cnv(s)
evaluates to True
?