Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That common subset doesn't include string handling.


You can absolutely do string handling in a common subset of Python 2 and Python 3. It won't work for legacy string handling code if you relied on implicit coercion, but then the same apps are unlikely to support unicode either.


> It won't work for legacy string handling code if you relied on implicit coercion

That's far from the only pitfall. For instance some of the P2 stdlib relies on implicit coercion to bytestrings whereas the Python 3 version has been properly converted to unicode (I discovered that when I tried to disable implicit coercion in one of the codebases I work with for cleanup/migration purposes).

So cross-platform string handling is not just a matter of properly splitting bytestrings and textstrings, but also finding out where "native strings" need to remain.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: