Avoid space around pow for None, True and False (#8189)

This commit is contained in:
Micha Reiser
2023-10-25 15:24:06 +09:00
committed by GitHub
parent 8304c41714
commit e36afc3324
3 changed files with 50 additions and 1 deletions

View File

@@ -506,7 +506,12 @@ const fn is_simple_power_operand(expr: &Expr) -> bool {
op: UnaryOp::Not, ..
}) => false,
Expr::Constant(ExprConstant {
value: Constant::Complex { .. } | Constant::Float(_) | Constant::Int(_),
value:
Constant::Complex { .. }
| Constant::Float(_)
| Constant::Int(_)
| Constant::None
| Constant::Bool(_),
..
}) => true,
Expr::Name(_) => true,