News for hackers. Stuff that matters.
Re:Show HN: Python-to-Python compiler for some 3.6 features ... by Grue3 on Thursday April 27, 2017 @12:13PM (#14212620)
"Why don't you just rewrite it in X?"

Because Python 3.X is not backwards compatible and we have millions of lines of production code in Python 2.X.

Re:Show HN: Python-to-Python compiler for some 3.6 features ... by jerryszczerry on Thursday April 27, 2017 @01:08PM (#14213073)
> Because Python 3.X is not backwards compatible and we have millions of lines of production code in Python 2.X.

I believe the common subset of Python 2 and 3 was created to ease that transition.

Re:Show HN: Python-to-Python compiler for some 3.6 features ... by kec on Thursday April 27, 2017 @02:55PM (#14213845)
That common subset doesn't include string handling.
Re:Show HN: Python-to-Python compiler for some 3.6 features ... by pekk on Thursday April 27, 2017 @04:55PM (#14214624)
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.
Re:Show HN: Python-to-Python compiler for some 3.6 features ... by masklinn on Friday April 28, 2017 @03:31AM (#14217551)
> 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.