Coder Social home page Coder Social logo

Tooling support about patma HOT 7 OPEN

viridia avatar viridia commented on May 27, 2024
Tooling support

from patma.

Comments (7)

viridia avatar viridia commented on May 27, 2024

One thing that might be helpful is to document the complete grammar of match in an appendix to the PEP. (Currently the PEP contains a section containing a simplified version of the grammar, but a deep tool implementer is going to want the complete grammar.)

from patma.

gvanrossum avatar gvanrossum commented on May 27, 2024

I wonder if this is going to be a show-stopper? We may be putting a big burden on the deep tools in particular.

Note that certain deep tools will be affected less, or at least not in their parser: those that use ast.parse() (like mypy). They will still have to learn how to visit Match and match_case nodes though, but at least the syntax definition is covered.

We would do well to put some effort into converting LibCST to PEG, though.

I created #65 with a task to add the full grammar to the PEP.

from patma.

viridia avatar viridia commented on May 27, 2024

This shouldn't be a show-stopper, otherwise you'd never be able to add a new Python statement again.

In fact, I think the choices we have made have been, overall, fairly friendly to third-party tools - like for example, making the indentation of the case clauses consistent with other statement forms.

Also, even if this feature lands in some future Python version, most users won't upgrade to that version for a while. That will give the third-party tools some time to catch up. Users who want to live on the bleeding edge will have to either suck it up, or pester their favorite tools for support, or possibly submit PRs.

from patma.

gvanrossum avatar gvanrossum commented on May 27, 2024

from patma.

viridia avatar viridia commented on May 27, 2024

How much effort do you think is involved in moving LibCST to PEG? It seems like a good idea if you plan to have any PEG-related functionality in Python in the future.

from patma.

gvanrossum avatar gvanrossum commented on May 27, 2024

It would be a significant effort. But we have a good starting point: the pegen parser generator can generate Python code too (with Python expressions in the actions of course). Maybe it wouldn't be that much effort to just investigate how LibCST currently constructs a parse tree? IIUC it currently uses 'parso', which itself is a fork of lib2to3.

from patma.

viridia avatar viridia commented on May 27, 2024

This seems like an ideal Summer of Code project.

from patma.

Related Issues (20)

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.