Skip to content

Cannot parse dict comprehension with negative number #55

@vaer-k

Description

@vaer-k

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: invalid codeBlack destroyed a valid Python fileT: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions