← All tasks
pythonInstagram/LibCST #574Not a task: not reproduced

Slots added to many classes, but not their bases

envgap__Instagram__LibCST-574

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
9563b4a9d5320a9ccc3568cd4a27b93c0acbed4f
Manifest
pyproject.toml
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

Instagram/LibCST #574 · read the original issue
👋 Hi there!



I found you use `add_slots` to add slots to a lot of classes (e.g. `libcst._nodes.expression.Annotation`). However, it seems `__slots__` is not present in many of their base classes (e.g. `libcst._nodes.base.CSTNode`), meaning the benefits are reduced.



Unless I'm missing something, we should be able to fix this for a free performance boost!



If you agree, I'd be happy to submit a PR



edit: a full list of slotless bases:



```

       - libcst._nodes.base.BaseLeaf

       - libcst._nodes.base.BaseValueToken

       - libcst._nodes.base.CSTNode

       - libcst._nodes.expression.BaseAssignTargetExpression

       - libcst._nodes.expression.BaseComp

       - libcst._nodes.expression.BaseDelTargetExpression

       - libcst._nodes.expression.BaseDict

       - libcst._nodes.expression.BaseDictElement

       - libcst._nodes.expression.BaseElement

       - libcst._nodes.expression.BaseExpression

       - libcst._nodes.expression.BaseFormattedStringContent

       - libcst._nodes.expression.BaseList

       - libcst._nodes.expression.BaseNumber

       - libcst._nodes.expression.BaseSet

       - libcst._nodes.expression.BaseSimpleComp

       - libcst._nodes.expression.BaseSlice

       - libcst._nodes.expression.BaseString

       - libcst._nodes.expression._BaseElementImpl

       - libcst._nodes.expression._BaseExpressionWithArgs

       - libcst._nodes.expression._BaseParenthesizedNode

       - libcst._nodes.expression._BasePrefixedString

       - libcst._nodes.expression._BaseSetOrDict

       - libcst._nodes.op.BaseAugOp

       - libcst._nodes.op.BaseBinaryOp

       - libcst._nodes.op.BaseBooleanOp

       - libcst._nodes.op.BaseCompOp

       - libcst._nodes.op.BaseUnaryOp

       - libcst._nodes.op._BaseOneTokenOp

       - libcst._nodes.op._BaseTwoTokenOp

       - libcst._nodes.statement.BaseCompoundStatement

       - libcst._nodes.statement.BaseSmallStatement

       - libcst._nodes.statement.BaseStatement

       - libcst._nodes.statement.BaseSuite

       - libcst._nodes.statement._BaseSimpleStatement

       - libcst._nodes.whitespace.BaseParenthesizableWhitespace

       - libcst._parser.types.config.BaseWhitespaceParserConfig

```
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]