Run across this:
import sys; print('Python %s on %s' % (sys.version, sys.platform))
Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit (AMD64)] on win32
b'\n' == b'\n'
True # well obviously
b'\n'[-1] == b'\n'
False # huh?
bytes(b'\n'[-1]) == b'\n'
False
b'\n'[-1] == 10
True
So it seems that when indexing in the byte array we get an integer value - why is this and how should I compare the values so I do not have to plugin the ascii value of the byte string element explicitly?