3 ms·
> Could a single Python interpreter somehow manage a mixture of 2 and 3 code? You could write code for a subset of 3 that would be fully functional on 2. There
by ak217 12y ago
> Could a single Python interpreter somehow manage a mixture of 2 and 3 code?
You could write code for a subset of 3 that would be fully functional on 2. There are a number of efforts out there to provide the missing compatibility layer that opened a chasm between Python 2 and 3. My contribution is https://github.com/kislyuk/eight https://github.com/kislyuk/eight.
Depending on what you're doing, writing code that is compatible with even the easiest combination of versions (2.7 and 3.3) can be unreasonably hard, and the officially recommended migration tools suck. IMO this has to do with a few unfortunate design decisions made back in the 2.x days (most egregiously the ascii default encoding and silent Unicode coercion), combined with an unwillingness to admit that 3.0-3.2 were really bad in not providing a migration path and work on a more comprehensive migration strategy and backports library.