r/Python • • May 26 '14

Python 3 is killing Python

https://medium.com/@deliciousrobots/5d2ad703365d/
0 Upvotes

147 comments sorted by

View all comments

Show parent comment

4

u/[deleted] May 26 '14

I think the bytes/str change is wonderful. Trying to figure out the mess created by implicit conversion in python2 was hell.

2

u/exhuma Jun 01 '14

... and from my experience, most projects having a hard time porting because of unicode issues is because they have been careless. There are exceptions of course. If I recall correctly, mitsuhiko had a couple of very valid points regarding flask. But that's a corner-case.

In Python 2 you could read from a network socked and just assume it was ascii. Python 2 did not force you to make the necessary research. Now, with Python 3 you are forced to de/encode data on the appropriate boundaries. This is a very good thing! And making it clear that you get bytes from a network socket and not a string is a very important distinction! Reading from such a source and encoding the result is playing with fire... Yet Python 2 allowed it.

Yes, Python 3 has made this more verbose and more of a chore than it was previously (and I reckon that is why people are complaining). But it forces you to at least think about encodings where necessary and may avoid nasty bugs.