mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-28 22:34:24 +00:00
Remove Expr
postfix from ExprNamed
, ExprIf
, and ExprGenerator
(#10229)
The expression types in our AST are called `ExprYield`, `ExprAwait`, `ExprStringLiteral` etc, except `ExprNamedExpr`, `ExprIfExpr` and `ExprGenratorExpr`. This seems to align with [Python AST's naming](https://docs.python.org/3/library/ast.html) but feels inconsistent and excessive. This PR removes the `Expr` postfix from `ExprNamedExpr`, `ExprIfExpr`, and `ExprGeneratorExpr`.
This commit is contained in:
parent
8b749e1d4d
commit
184241f99a
64 changed files with 418 additions and 428 deletions
|
@ -648,17 +648,17 @@ impl Format<PyFormatContext<'_>> for FormatEnclosingNode<'_> {
|
|||
AnyNodeRef::ElifElseClause(node) => node.format().fmt(f),
|
||||
|
||||
AnyNodeRef::ExprBoolOp(_)
|
||||
| AnyNodeRef::ExprNamedExpr(_)
|
||||
| AnyNodeRef::ExprNamed(_)
|
||||
| AnyNodeRef::ExprBinOp(_)
|
||||
| AnyNodeRef::ExprUnaryOp(_)
|
||||
| AnyNodeRef::ExprLambda(_)
|
||||
| AnyNodeRef::ExprIfExp(_)
|
||||
| AnyNodeRef::ExprIf(_)
|
||||
| AnyNodeRef::ExprDict(_)
|
||||
| AnyNodeRef::ExprSet(_)
|
||||
| AnyNodeRef::ExprListComp(_)
|
||||
| AnyNodeRef::ExprSetComp(_)
|
||||
| AnyNodeRef::ExprDictComp(_)
|
||||
| AnyNodeRef::ExprGeneratorExp(_)
|
||||
| AnyNodeRef::ExprGenerator(_)
|
||||
| AnyNodeRef::ExprAwait(_)
|
||||
| AnyNodeRef::ExprYield(_)
|
||||
| AnyNodeRef::ExprYieldFrom(_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue