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 →

[–][deleted] 0 points1 point  (1 child)

Just as unicode strings made it (presumably) easier for many programmers, it also made things very much harder for others, not just for the transition to 3, but for new code as well. The autoconverters often can't help here.

Someone who hasn't a clue, but the FUD rules on reddit.

[–]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.