mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 06:42:02 +00:00

Both `list` and `dict` expect only a single positional argument. Giving more positional arguments, or a keyword argument, is a `TypeError` and neither the lint rule nor its fix make sense in that context. Closes #15810
8 lines
222 B
Python
8 lines
222 B
Python
x = [1, 2, 3]
|
|
list([i for i in x])
|
|
|
|
# Skip when too many positional arguments
|
|
# or keyword argument present.
|
|
# See https://github.com/astral-sh/ruff/issues/15810
|
|
list([x for x in "XYZ"],[])
|
|
list([x for x in "XYZ"],foo=[])
|