summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lee <IanLee1521@gmail.com>2016-02-24 09:00:13 -0800
committerIan Lee <IanLee1521@gmail.com>2016-02-24 09:00:13 -0800
commit4fb305e7319b65cfa8fca5a1313d581c1e01b39a (patch)
treea2af36dc1440152a62c07fb0e7aed54ea255c480
parent8664e18b92eb5ab8e66cc4c3b0c8d49cad14791e (diff)
parent18b12f0eb143b501389e7a65bb2f84ea9bc18067 (diff)
downloadpep8-4fb305e7319b65cfa8fca5a1313d581c1e01b39a.tar.gz
Merge pull request #383 from czyzykowski/patch-1
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 ebf70bc..bfbea7f 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