From ad86a1b818eee307c9fd558c9d7948f20d6fef71 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 5 Dec 2019 12:33:18 +0300 Subject: Adds matmul operator support, fixes #768 --- pycodestyle.py | 2 +- testsuite/E22.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pycodestyle.py b/pycodestyle.py index 6d3b554..fc02c00 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -113,7 +113,7 @@ PyCF_ONLY_AST = 1024 SINGLETONS = frozenset(['False', 'None', 'True']) KEYWORDS = frozenset(keyword.kwlist + ['print', 'async']) - SINGLETONS UNARY_OPERATORS = frozenset(['>>', '**', '*', '+', '-']) -ARITHMETIC_OP = frozenset(['**', '*', '/', '//', '+', '-']) +ARITHMETIC_OP = frozenset(['**', '*', '/', '//', '+', '-', '@']) WS_OPTIONAL_OPERATORS = ARITHMETIC_OP.union(['^', '&', '|', '<<', '>>', '%']) # Warn for -> function annotation operator in py3.5+ (issue 803) FUNCTION_RETURN_ANNOTATION_OP = ['->'] if sys.version_info >= (3, 5) else [] diff --git a/testsuite/E22.py b/testsuite/E22.py index 4974cb3..7ea2792 100644 --- a/testsuite/E22.py +++ b/testsuite/E22.py @@ -84,6 +84,10 @@ i = 1or 0 1is 1 #: E225 1in [] +#: E225 +i = 1 @2 +#: E225 +i = 1@ 2 #: E225 E226 i=i+1 #: E225 E226 @@ -150,6 +154,7 @@ if not -5 < x < +5: print >>sys.stderr, "x is out of range." print >> sys.stdout, "x is an integer." x = x / 2 - 1 +x = 1 @ 2 if alpha[:-i]: *a, b = (1, 2, 3) -- cgit v1.2.1