mirror of
https://github.com/astral-sh/ruff
synced 2026-01-09 07:34:06 -05:00
a843a00f6bac7d31293c0c9c979c48638df0165f
type keyword (#97)
Extends #95 Closes #82 Adds parsing of new `type` soft keyword for defining type aliases. Supports type alias statements as defined in PEP 695 e.g. ```python type IntOrStr = int | str type ListOrSet[T] = list[T] | set[T] type AnimalOrVegetable = Animal | "Vegetable" type RecursiveList[T] = T | list[RecursiveList[T]] ``` All type parameter kinds are supported as in #95. Builds on soft keyword abstractions introduced in https://github.com/RustPython/RustPython/pull/4519
RustPython parser as a library
This project is forked from RustPython project. The parser is one of the core part of RustPython and Ruff project.
We try to keep these crates as a well-packaged library for more potential users.
Projects
- RustPython is a Python interpreter
- Ruff is an extremely fast Python linter
- Pylyzer is a static code analyzer / language server for Python
- Baembal is a Python package to accelerate
ast.parse
Languages
Rust
96.1%
Python
2.6%
TypeScript
0.9%
RenderScript
0.2%
Shell
0.1%