To help writing Python 2/3 code the -b flag should switch on a warning when comparing an int to a bytes object in Python 2. This will help when someone writes something like b'abcd' == b'c' and it always returns False thanks to the indexing returning 99 in Python 3.
This will help when someone writes something like b'abcd' == b'c'
What if someone writes line[-1] == 0 and line is a Unicode string? Should we emit a warning?
I patched locally PyUnicode_RichCompare() to emit a warning. Hum, there are *many* warnings in argparse, http.client, and many other modules. I don't think that it's a good idea. It looks common to use a string for a sentinel (ex: state = "UNKNOWN") and then store an int (ex: state = 0). So comparison need to check the type (ex: isinstance(state, str) and state == "UNKNOWN") which is verbose and annoying.