Fix spurious space after unary expression
This happened when the operand was a complex expression. Fixes #15
This commit is contained in:
parent
da3c2f3582
commit
5370714c96
@ -257,6 +257,12 @@ You can still try but prepare to be disappointed.
|
|||||||
|
|
||||||
* fixed spurious space in parenthesized set expressions (#7)
|
* fixed spurious space in parenthesized set expressions (#7)
|
||||||
|
|
||||||
|
* fixed spurious space after opening parentheses and in default
|
||||||
|
arguments (#14, #17)
|
||||||
|
|
||||||
|
* fixed spurious space after unary operators when the operand was
|
||||||
|
a complex expression (#15)
|
||||||
|
|
||||||
|
|
||||||
### 18.3a0
|
### 18.3a0
|
||||||
|
|
||||||
|
3
black.py
3
black.py
@ -815,6 +815,9 @@ def whitespace(leaf: Leaf) -> str:
|
|||||||
if prevp.parent and prevp.parent.type == syms.subscript:
|
if prevp.parent and prevp.parent.type == syms.subscript:
|
||||||
return NO
|
return NO
|
||||||
|
|
||||||
|
elif prevp.parent and prevp.parent.type == syms.factor:
|
||||||
|
return NO
|
||||||
|
|
||||||
elif prev.type in OPENING_BRACKETS:
|
elif prev.type in OPENING_BRACKETS:
|
||||||
return NO
|
return NO
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
-1
|
-1
|
||||||
~int and not v1 ^ 123 + v2 | True
|
~int and not v1 ^ 123 + v2 | True
|
||||||
(~int) and (not ((v1 ^ (123 + v2)) | True))
|
(~int) and (not ((v1 ^ (123 + v2)) | True))
|
||||||
|
flags & ~ select.EPOLLIN and waiters.write_task is not None
|
||||||
lambda arg: None
|
lambda arg: None
|
||||||
lambda a=True: a
|
lambda a=True: a
|
||||||
lambda a, b, c=True: a
|
lambda a, b, c=True: a
|
||||||
@ -155,6 +156,7 @@ async def f():
|
|||||||
-1
|
-1
|
||||||
~int and not v1 ^ 123 + v2 | True
|
~int and not v1 ^ 123 + v2 | True
|
||||||
(~int) and (not ((v1 ^ (123 + v2)) | True))
|
(~int) and (not ((v1 ^ (123 + v2)) | True))
|
||||||
|
flags & ~select.EPOLLIN and waiters.write_task is not None
|
||||||
lambda arg: None
|
lambda arg: None
|
||||||
lambda a=True: a
|
lambda a=True: a
|
||||||
lambda a, b, c=True: a
|
lambda a, b, c=True: a
|
||||||
|
Loading…
Reference in New Issue
Block a user