QUAL003infoPro

complex-tuple

Tuples with 3+ elements are hard to understand - use a dataclass instead

Applies to: Python

Why this matters

When you use Tuple[str, int, float, bool], code like `data[2]` is confusing - what is element 2? A dataclass with named fields like `data.price` is much clearer and helps prevent bugs from accessing the wrong index.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, QUAL003 includedstablestack explain QUAL003

QUAL003 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: QUAL003