[New-bugs-announce] [issue9043] 2to3 doesn't handle byte comparison well

Virgil Dupras report at bugs.python.org
Mon Jun 21 16:46:15 CEST 2010

New submission from Virgil Dupras <hsoft at hardcoded.net>:

If we run 2to3 on the following code:

s = b' '
print s[0] == s

we end up with this:

s = b' '
print(s[0] == s)

However, the first code, under python2 prints True while the converted code, under python3 prints False.

Shouldn't 2to3 convert this code to:

s = b' '
print s[0:1] == s


components: 2to3 (2.x to 3.0 conversion tool)
messages: 108272
nosy: vdupras
priority: normal
severity: normal
status: open
title: 2to3 doesn't handle byte comparison well
type: behavior
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list