Hacker News new | ask | show | jobs
by sheepz 3286 days ago
Most Python 2 codebases probably have a lot of unknown bugs in them related to Unicode. The code will work fine for cases where the inputs are ASCII, but will subtly break if unicode inputs are provided.

In term's of code reliability, Python 3's approach is much more sane.

2 comments

I work at a company that uses Python 2 in older projects and Python 3 in newer projects, and this 100% matches my experience. Python 2's string implementation is simply busted, and the benefit you get in exchange for that brokenness is that some cases are slightly shorter to write.
And if Python simply used utf-8 everywhere, those ASCII expecting code would continue to work fine when unicode inputs are provided.