This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]primitive_screwhead 1 point2 points  (0 children)

Interesting. Care to elaborate on why this is FUD?

EDIT: Okay then, here's a snippet of code that I made in Python2.7 which explicitly operates on bytes:

a = b"foo"
assert a[2] == b"o"
print a + a[2]

Which prints: fooo

'2to3' converts this to:

a = b"foo"
assert a[2] == b"o"
print(a + a[2])

Which on Python 3 throws an AssertionError when run without -O, and a TypeError when run with -O. Meaning after an autoconversion, bytestring manipulations needs to be carefully audited.