ruff/crates/ruff_python_ast/src
Carl Meyer c80b9a4a90
Reduce size of Stmt from 144 to 120 bytes (#11051)
## Summary

I happened to notice that we box `TypeParams` on `StmtClassDef` but not
on `StmtFunctionDef` and wondered why, since `StmtFunctionDef` is bigger
and sets the size of `Stmt`.

@charliermarsh found that at the time we started boxing type params on
classes, classes were the largest statement type (see #6275), but that's
no longer true.

So boxing type-params also on functions reduces the overall size of
`Stmt`.

## Test Plan

The `<=` size tests are a bit irritating (since their failure doesn't
tell you the actual size), but I manually confirmed that the size is
actually 120 now.
2024-04-19 17:02:17 -06:00
..
visitor Remove `Expr` postfix from `ExprNamed`, `ExprIf`, and `ExprGenerator` (#10229) 2024-03-04 12:55:01 +01:00
all.rs Respect `# noqa` directives on `__all__` openers (#10798) 2024-04-06 14:51:17 +00:00
comparable.rs Remove `Expr` postfix from `ExprNamed`, `ExprIf`, and `ExprGenerator` (#10229) 2024-03-04 12:55:01 +01:00
docstrings.rs Move Python whitespace utilities into new `ruff_python_whitespace` crate (#4993) 2023-06-10 00:59:57 +00:00
expression.rs Use `ExprFString` for `StringLike::FString` variant (#10311) 2024-03-14 13:30:22 +05:30
hashable.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
helpers.rs Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
identifier.rs Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
imports.rs Use Rust 1.75 toolchain (#9437) 2024-01-08 18:03:16 +01:00
int.rs Include radix base prefix in large number representation (#7700) 2023-09-28 20:38:06 +00:00
lib.rs Split `CallPath` into `QualifiedName` and `UnqualifiedName` (#10210) 2024-03-04 09:06:51 +00:00
name.rs Improve handling of builtin symbols in linter rules (#10919) 2024-04-16 11:37:31 +01:00
node.rs Start tracking quoting style in the AST (#10298) 2024-03-08 19:11:47 +00:00
nodes.rs Reduce size of Stmt from 144 to 120 bytes (#11051) 2024-04-19 17:02:17 -06:00
parenthesize.rs Comments outside expression parentheses (#7873) 2023-10-19 09:24:11 +00:00
relocate.rs Remove `Expr` postfix from `ExprNamed`, `ExprIf`, and `ExprGenerator` (#10229) 2024-03-04 12:55:01 +01:00
statement_visitor.rs Remove `Stmt::TryStar` (#6566) 2023-08-14 13:39:44 -04:00
stmt_if.rs Misc. small tweaks from perusing modules (#9383) 2024-01-03 12:30:25 -05:00
str.rs Unify enums used for internal representation of quoting style (#10383) 2024-03-13 17:19:17 +00:00
traversal.rs [`flake8-simplify`] Implement `enumerate-for-loop` (`SIM113`) (#7777) 2024-01-14 11:00:59 -05:00
types.rs Remove `RefEquality` (#6393) 2023-08-07 16:04:50 +00:00
visitor.rs Remove `Expr` postfix from `ExprNamed`, `ExprIf`, and `ExprGenerator` (#10229) 2024-03-04 12:55:01 +01:00
whitespace.rs Use consistent re-export from `ruff_source_file` (#9320) 2023-12-30 14:48:45 -05:00