Derived from the flake8-comprehensions linter.
Fix is always available.
What it does#
list calls that take unnecessary list or tuple literals as
Why is this bad?#
It's unnecessary to use a list or tuple literal within a
since there is a literal syntax for these types.
If a list literal is passed in, then the outer call to
list() should be
removed. Otherwise, if a tuple literal is passed in, then it should be
rewritten as a
This rule's fix is marked as unsafe, as it may occasionally drop comments when rewriting the call. In most cases, though, comments will be preserved.