DET003infoPro

missing-sort-tiebreaker

Sorting by a single field without tiebreaker can produce unstable order

Applies to: Python

Why this matters

When you sort by just one field (like a score), items with the same score might appear in random order. Adding a tiebreaker (like sorting by name too) ensures consistent ordering even when the primary sort key is the same.

Catch it before it ships

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

DET003 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: DET003