Derived from the refurb linter.
Fix is sometimes available.
This rule is unstable and in preview. The
--preview flag is required for use.
What it does#
Checks for consecutive calls to
Why is this bad?#
Consecutive calls to
append can be less efficient than batching them into
append resizes the list individually, whereas an
extend can resize the list once for all elements.
This rule is prone to false negatives due to type inference limitations, as it will only detect lists that are instantiated as literals or annotated with a type annotation.