bad-builtin-groupby (ODOO019)
Preview (since 0.16.2.2) · Related issues · View source
Derived from the odoo linter.
This rule is unstable and in preview. The --preview flag is required for use.
What it does
Checks for use of itertools.groupby.
Why is this bad?
itertools.groupby only groups consecutive runs, which is a frequent footgun. Prefer
odoo.tools.groupby, which sorts first.
Example
Use instead: