News for hackers. Stuff that matters.
Re:Ty: A fast Python type checker and language server by zanie on Wednesday May 07, 2025 @03:49PM (#43919910)
As in, how are we parsing the Python code into an AST?

CPython uses a generated parser. The grammar is defined in https://github.com/python/cpython/blob/main/Grammar/python.g... which is used to generate the specification at https://docs.python.org/3/reference/grammar.html#full-gramma...

We use a hand-written parser, in Rust, based on the specification. We've written that previously at https://astral.sh/blog/ruff-v0.4.0#a-hand-written-parser

There are no comments on this comment yet.