Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using typed-astunparse #43

Open
mitar opened this issue Sep 25, 2017 · 6 comments
Open

Consider using typed-astunparse #43

mitar opened this issue Sep 25, 2017 · 6 comments

Comments

@mitar
Copy link

mitar commented Sep 25, 2017

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).

@nvbn
Copy link
Owner

nvbn commented Sep 27, 2017

py-backwards was using it before and there were problems similar to simonpercivall/astunparse#18 and simonpercivall/astunparse#17

@mitar
Copy link
Author

mitar commented Sep 27, 2017

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.

@nvbn
Copy link
Owner

nvbn commented Sep 27, 2017

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.

@mitar
Copy link
Author

mitar commented Sep 27, 2017

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.

@nvbn
Copy link
Owner

nvbn commented Sep 27, 2017

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.

@jayvdb
Copy link

jayvdb commented Oct 10, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants