r/Python • • May 30 '19

Dear python2 user

Post image
1.9k Upvotes

275 comments sorted by

View all comments

Show parent comments

1

u/[deleted] May 30 '19

Would you please explain that?

5

u/billsil May 31 '19

The only painful change about Python 3 is how unicode is handled. The tutorials still suck and nobody tells you even how to figure out what encoding you have. The reality is that user files are in a variety of encodings and they don’t even know what that is.

No other change about python 3 is even worth discussing when planning/worrying about the transition to python 3.

2

u/icegreentea May 31 '19

I think you can add the bytes/str split (which is closely related to the unicode handling). Any code base in python2 that was using str type to represent bytes is in a world of pain converting to python3.

5

u/billsil May 31 '19

That’d be fine. It’s when you’re inconsistent that the pain really sets in. Python 2 did weird ass shit by flipping the encoding multiple times, so you had to encode when you got a decode error and vice verse. Then when you print it, it wouldn’t print correctly even when you had done things right. Python 3 fixed that.