py-backwards
py-backwards copied to clipboard
Consider using typed-astunparse
It seems this one supports also preserving type comments: https://github.com/mbdevpl/typed-astunparse (in contrast with https://github.com/nvbn/py-backwards-astunparse).
py-backwards was using it before and there were problems similar to https://github.com/simonpercivall/astunparse/issues/18 and https://github.com/simonpercivall/astunparse/issues/17
Wouldn't be easier to make PRs to it to fix those instead of creating a fork? Because having typed unparse is really useful and makes #44 work great.
Not that much, typed-astunparse is based on astunparse.
And pull requests were already submitted to astunparse.
Also, are we really need type comments in compiled code? I think it would be better to have a less readable compiled code and something like source maps.
And pull requests were already submitted to astunparse.
Hm, it seems they are waiting to be rebased?
Also, are we really need type comments in compiled code? I think it would be better to have a less readable compiled code and something like source maps.
Yes, one could automatically generate typing stub files. But comments seemed easier at a time. Otherwise one would have to create whole infrastructure to pass those types around and make those extra files.
Hm, it seems they are waiting to be rebased?
https://github.com/simonpercivall/astunparse/pulls
Yes, one could automatically generate typing stub files. But comments seemed easier at a time. Otherwise one would have to create whole infrastructure to pass those types around and make those extra files.
As I remember, in the current implementation of packager original sources are still in the package. So IDE will see original sources with types. Not sure about mypy.
And source maps will be mostly used for stack traces, like in js.
Now closed https://github.com/simonpercivall/astunparse/pull/19 and https://github.com/simonpercivall/astunparse/pull/20