Coder Social home page Coder Social logo

Comments (9)

mbdevpl avatar mbdevpl commented on June 12, 2024

Thanks for reporting, will look into that!

from typed-astunparse.

mitar avatar mitar commented on June 12, 2024

(Also see that the docstring does not use """.)

from typed-astunparse.

mbdevpl avatar mbdevpl commented on June 12, 2024

I've verified that the per-argument type comments are indeed not working. I'll fix it.

However, the docstring issue is out of scope for this unparser. There was a similar issue upstream (astunparse): simonpercivall/astunparse#13 however it was closed.

I'm working towards implementing proper docstring unparsing, (as well as arbitrary comment parsing and unparsing) in a different module: https://github.com/mbdevpl/horast however it's not nearly ready yet.

from typed-astunparse.

mbdevpl avatar mbdevpl commented on June 12, 2024

And, there seems to be an issue in typed_ast with parsing per-argument type comments in all cases: python/typed_ast#58 so even if I generate valid code, in some cases I actually cannot verify its validity.

from typed-astunparse.

mitar avatar mitar commented on June 12, 2024

Thanks for looking into this.

from typed-astunparse.

mitar avatar mitar commented on June 12, 2024

(BTW, I used your project here: nvbn/py-backwards#44)

from typed-astunparse.

mbdevpl avatar mbdevpl commented on June 12, 2024

Not minding the issue with typed_ast (hopefully it'll get resolved someday) I added the per-argument type comment unparsing and released https://pypi.python.org/pypi/typed-astunparse/2.0.2

from typed-astunparse.

mitar avatar mitar commented on June 12, 2024

Oho! Thanks!

from typed-astunparse.

mbdevpl avatar mbdevpl commented on June 12, 2024

Oh, and BTW, I just found out that docstrings might be properly stored in AST starting from Python 3.7 - if they will be, then I guess astunparse and typed_astunparse will handle them properly. https://bugs.python.org/issue29463

from typed-astunparse.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.