mirror of
https://github.com/astral-sh/ruff.git
synced 2026-11-24 18:29:13 +08:00
## Summary Stacks on #25726 and enables Clippy's `iter_over_hash_type` restriction lint across the workspace, so new hash-map and hash-set iterations must make their ordering assumptions explicit. Most existing loops are order-independent and use a site-local `#[expect(clippy::iter_over_hash_type)]`. At the order-sensitive sites, this sorts before iteration. (In practice, that should stabilize some parser fixtures, configuration diagnostics, union normalization, etc.). This lint is kind of annoying, but given how much we want to crack down on non-determinism in ty, it seems worthwhile to enable IMO.
Ruff Python Parser
Ruff's Python parser is a hand-written recursive descent parser which can parse Python source code into an Abstract Syntax Tree (AST). It also utilizes the Pratt parsing technique to parse expressions with different precedence.
Try out the parser in the playground.
Python version support
The parser supports the latest Python syntax, which is currently Python 3.12.
It does not throw syntax errors if it encounters a syntax feature that is not
supported by the target-version.
This will be fixed in a future release (see https://github.com/astral-sh/ruff/issues/6591).
Contributing
Refer to the contributing guidelines to get started and GitHub issues with the parser label for issues that need help.