agentune icon indicating copy to clipboard operation
agentune copied to clipboard

Define and follow guidelines for collections

Open leonidb opened this issue 1 year ago • 1 comments

Description

Suggestion

  1. Use tuple in attrs classes attributes
  2. Use Sequence in public API
  3. Wherever we create a collection - use tuple if it can be immutable, list if it can't be mutated
  4. Don't use List/Tuple/Mapping - enforce it by this ruff rule : "UP006"

@danarmak Sounds good?

leonidb avatar Jul 01 '25 15:07 leonidb

Re (3) do you mean in local variables? I'm not convinced we should forbid using lists "unnecessarily" in local variables.

danarmak avatar Jul 02 '25 09:07 danarmak