Skip to content

Unify OperatorPrecedence enums #16071

@MichaReiser

Description

@MichaReiser

Description

There are now 3 OperatorPrecedence structs in ruff

  • Formatter (only the expression one, the pattern one is different)
  • Linter
  • Parser
  1. Move the Linter OperatorPrecedence struct into ruff-python-ast and expose a precedence() method on Expr (and `ExpressionRef) and ideally on each Expression node.
  2. Try to replace some of the other OperatorPrecedence structs with the one now defined in the AST crate

Ideally, these would be two separate PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedContributions especially welcomeinternalAn internal refactor or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions