Hacker News new | past | comments | ask | show | jobs | submit login

They did that where possible (from __future__ imports, forwards compatibility changes to a bunch of internal apis (the C extension api, as well as stuff like the code object)), but there's not a cross-compatible way to handle the unicode/bytes change. Python2 has, essentially, a single text-bytes str type. Python3 has different ones. You can't cross that boundary from 2 to 3, because the runtime has no way to know which of text or bytes a given str is.

What you can do is use libraries like six to make code run just fine in both versions, and six-ify on a per file basis. This works pretty well.




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

Search: