summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Czyżykowski <lukasz.czyzykowski@gmail.com>2015-02-19 15:59:27 +0100
committerŁukasz Czyżykowski <lukasz.czyzykowski@gmail.com>2015-02-19 15:59:27 +0100
commit18b12f0eb143b501389e7a65bb2f84ea9bc18067 (patch)
tree8ac7973ab8d10f5a6b97f31339650d345e0c3e17
parentdcfdfda78527392433a78d8ed68b6d5a78cdf6c2 (diff)
downloadpep8-18b12f0eb143b501389e7a65bb2f84ea9bc18067.tar.gz
Fix problem with treating ~ operator as binary.
-rwxr-xr-xpep8.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pep8.py b/pep8.py
index d7907e5..bca7985 100755
--- a/pep8.py
+++ b/pep8.py
@@ -1017,13 +1017,14 @@ def break_around_binary_operator(logical_line, tokens):
Okay: x = '''\n''' + ''
Okay: foo(x,\n -y)
Okay: foo(x, # comment\n -y)
+ Okay: var = (1 &\n ~2)
"""
def is_binary_operator(token_type, text):
# The % character is strictly speaking a binary operator, but the
# common usage seems to be to put it next to the format parameters,
# after a line break.
return ((token_type == tokenize.OP or text in ['and', 'or']) and
- text not in "()[]{},:.;@=%")
+ text not in "()[]{},:.;@=%~")
line_break = False
unary_context = True