--- source: crates/ruff_python_formatter/tests/fixtures.rs input_file: crates/ruff_python_formatter/resources/test/fixtures/black/simple_cases/bracketmatch.py --- ## Input ```py for ((x in {}) or {})['a'] in x: pass pem_spam = lambda l, spam = { "x": 3 }: not spam.get(l.strip()) lambda x=lambda y={1: 3}: y['x':lambda y: {1: 2}]: x ``` ## Black Differences ```diff --- Black +++ Ruff @@ -1,4 +1,4 @@ for ((x in {}) or {})["a"] in x: pass -pem_spam = lambda l, spam={"x": 3}: not spam.get(l.strip()) -lambda x=lambda y={1: 3}: y["x" : lambda y: {1: 2}]: x +pem_spam = lambda x: True +lambda x: True ``` ## Ruff Output ```py for ((x in {}) or {})["a"] in x: pass pem_spam = lambda x: True lambda x: True ``` ## Black Output ```py for ((x in {}) or {})["a"] in x: pass pem_spam = lambda l, spam={"x": 3}: not spam.get(l.strip()) lambda x=lambda y={1: 3}: y["x" : lambda y: {1: 2}]: x ```