[New-bugs-announce] [issue23681] Have -b warn when directly comparing ints and bytes

Brett Cannon report at bugs.python.org
Mon Mar 16 18:05:30 CET 2015


New submission from Brett Cannon:

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'[2] == b'c'` and it always returns False thanks to the indexing returning 99 in Python 3.

----------
assignee: brett.cannon
components: Interpreter Core
messages: 238228
nosy: brett.cannon
priority: normal
severity: normal
stage: test needed
status: open
title: Have -b warn when directly comparing ints and bytes
type: enhancement
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23681>
_______________________________________


More information about the New-bugs-announce mailing list