Hacker News new | ask | show | jobs
by baq 960 days ago
the most important benefit that most people ignored until they needed to debug something was fixing the horribly broken exception system in Python 2, were you were losing your stack traces when reraising.

most people who don't come from native-English countries also immediately benefited from unicode awareness by default. there were a few folks who cried about having to prefix bytes with b'' when pushing text through sockets, a vocal but small minority.

1 comments

> there were a few folks who cried about having to prefix bytes with b'' when pushing text through sockets

It wasn't just that; any program with string literals in it that were being treated as bytes in Python 2 would have to have all those string literals prefixed with b in Python 3; otherwise the program would break.

Also, defaulting to unicode meant having to have a default encoding that became critical in many more places--for example, the standard streams (stdin, stdout, stderr) were now unicode by default instead of bytes, so there were now plenty of new footguns when the standard stream encoding that Python guessed was wrong and you had no way to change it. Not to mention that if the standard streams were pipes instead of ttys, unicode made no sense anyway.