On Mon, Sep 20, 2021 at 8:58 AM Thomas Grainger <tagrain@gmail.com> wrote:
I don't think the python syntax should be beholden to syntax highlighting tools, eventually some syntax feature that PEG enables will require every parser or highlighter to switch to a similar or more powerful parse tool

But that's not how syntax highlighting works in editors. You typically don't get to choose the parsing tool used for syntax highlighting, you just define the grammar using whatever is provided by the editor (which has always been regexes based on my experience). So there's no way to "require" every editor out there to switch to a PEG parser or equivalent to support Python's grammar because that's asking every editor to change how syntax highlighting is implemented at a lower level.

Having said all that, I think as long as we understand that this is a side-effect then it's fine; syntax highlighting is usually not tied to semantics in an editor so it shouldn't be a blocker on this. If people care they simply won't use the same type of quotes in their code (which I bet is what most people will do unless Black says otherwise 😉).

But I also think this means we definitely have to get a parser module for tools together as this is way more potential breakage than just parentheses for `with` statements and I don't know if formatting tools can just move to the AST module at that point. 😅