I am not a Python developer, but thanks for not using the unnecessary term "transpiler".
Show HN: Python-to-Python compiler for some 3.6 features in older versions
11–20 of 113 posts
Re: Show HN: Python-to-Python compiler for some 3.6 features in older versions
#12I never was able to find anyone talking about that goal with mypy, but it looks like this tool may be a solution.
Re: Show HN: Python-to-Python compiler for some 3.6 features in older versions
#13I am not a Python developer, but thanks for not using the unnecessary term "transpiler".
But isn't that what this is? I was under the impression that a compiler turns source code into machine code whereas a transpiler turns source code into differnet source code?
Re: Show HN: Python-to-Python compiler for some 3.6 features in older versions
#14Imho this is a much better solution than 2to3. If python3 adoption is the goal, python3 should be the input and not the output.
Forward adoption is one thing the JS ecosystem does well (probably due to the sheer necessity of it given the many varying platforms outside control of the developer). Transpiling supersets of the language to the lowest supportable denominator is such an elegant approach. Thanks to projects like babel, typescript, webpack, etc, you can write your code in the most modern language spec, but target platforms not yet sup…
The only reason the Python 2/3 issue exists is because of just enough breaking backwards compatibility in a way that a lot of people didn't agree with in the community. This isn't a thing in Ruby.
Re: Show HN: Python-to-Python compiler for some 3.6 features in older versions
#15Re: Show HN: Python-to-Python compiler for some 3.6 features in older versions
#16A writeup on how you handled mapping bytes, bytearrays, unicode, etc, to 2.7 constructs would be interesting.
In code that supports both 2 and 3, I end up with ugly stuff testing sys.hexversion to deal with 3rd party libraries, like pyserial, that expect str in v2, bytearrays in v3.
Re: Show HN: Python-to-Python compiler for some 3.6 features in older versions
#17Re: Show HN: Python-to-Python compiler for some 3.6 features in older versions
#18Serious question: Why would anyone still be doing anything with Python 2.7 except porting the last remnants of their code base to 3.X?
Re: Show HN: Python-to-Python compiler for some 3.6 features in older versions
#19Imho this is a much better solution than 2to3. If python3 adoption is the goal, python3 should be the input and not the output.
> If python3 adoption is the goal So the goal should be to have codebases in Python 3. > python3 should be the input and not the output How would this accomplish that goal? All the codebases would be in Python 2 then. I bet that removing barriers to run Python 2 code would cause it to stay around longer.
Re: Show HN: Python-to-Python compiler for some 3.6 features in older versions
#20Serious question: Why would anyone still be doing anything with Python 2.7 except porting the last remnants of their code base to 3.X?
Because sometimes the amount of work required to port a 2.7 project to 3.x isn't worth it.