mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +00:00
17 lines
388 B
Python
17 lines
388 B
Python
# Errors
|
|
1 in [1, 2, 3]
|
|
1 in (1, 2, 3)
|
|
1 in (
|
|
1, 2, 3
|
|
)
|
|
fruits = ["cherry", "grapes"]
|
|
"cherry" in fruits
|
|
_ = {key: value for key, value in {"a": 1, "b": 2}.items() if key in ("a", "b")}
|
|
|
|
# OK
|
|
fruits in [[1, 2, 3], [4, 5, 6]]
|
|
fruits in [1, 2, 3]
|
|
1 in [[1, 2, 3], [4, 5, 6]]
|
|
_ = {key: value for key, value in {"a": 1, "b": 2}.items() if key in (["a", "b"], ["c", "d"])}
|
|
1 in []
|
|
1 in ()
|