X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/b1a7600b0a0691821926a07015f7bc66ca0ae4e9..92b377556e24616d5980a9010cf558da7fa35d28:/black.py diff --git a/black.py b/black.py index 81efa59..0dd7630 100644 --- a/black.py +++ b/black.py @@ -22,7 +22,7 @@ from blib2to3 import pygram, pytree from blib2to3.pgen2 import driver, token from blib2to3.pgen2.parse import ParseError -__version__ = "18.3a2" +__version__ = "18.3a3" DEFAULT_LINE_LENGTH = 88 # types syms = pygram.python_symbols @@ -340,6 +340,7 @@ MATH_OPERATORS = { token.AMPER, token.PERCENT, token.CIRCUMFLEX, + token.TILDE, token.LEFTSHIFT, token.RIGHTSHIFT, token.DOUBLESTAR, @@ -888,7 +889,11 @@ def whitespace(leaf: Leaf) -> str: # noqa C901 if prevp.parent and prevp.parent.type in {syms.subscript, syms.sliceop}: return NO - elif prevp.parent and prevp.parent.type in {syms.factor, syms.star_expr}: + elif ( + prevp.parent + and prevp.parent.type in {syms.factor, syms.star_expr} + and prevp.type in MATH_OPERATORS + ): return NO elif prev.type in OPENING_BRACKETS: