black icon indicating copy to clipboard operation
black copied to clipboard

Cannot parse dict comprehension with negative number

Open vaer-k opened this issue 8 years ago • 1 comments

Operating system: MacOS 10.12.6 Python version: 3.6 Black version: 18.3a3 Does also happen on master: yes

{a: b * -2 for a, b in dictionary.items()} becomes {a: b * -2for a, b in dictionary.items()}

which, surprisingly to me, doesn't break, but is clearly wrong.

{a: b * 2 for a, b in dictionary.items()} is not affected by this issue (black leaves it alone.)

vaer-k avatar Mar 21 '18 22:03 vaer-k

Thanks for your report! This is now fixed. ✨ 🍰 ✨

ambv avatar Mar 22 '18 01:03 ambv