From e8a5c67b23678d778982a202ee0c46513e584b05 Mon Sep 17 00:00:00 2001 From: Steven Myint Date: Mon, 21 Dec 2015 17:46:45 -0800 Subject: Handle matrix-multiplication operator ("@") https://docs.python.org/3.6/whatsnew/3.5.html#pep-465-a-dedicated-infix-operator-for-matrix-multiplication This fixes https://bugs.launchpad.net/pyflakes/+bug/1523163. --- pyflakes/checker.py | 3 ++- pyflakes/test/test_other.py | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pyflakes/checker.py b/pyflakes/checker.py index fe20146..7155b54 100644 --- a/pyflakes/checker.py +++ b/pyflakes/checker.py @@ -767,7 +767,8 @@ class Checker(object): # same for operators AND = OR = ADD = SUB = MULT = DIV = MOD = POW = LSHIFT = RSHIFT = \ BITOR = BITXOR = BITAND = FLOORDIV = INVERT = NOT = UADD = USUB = \ - EQ = NOTEQ = LT = LTE = GT = GTE = IS = ISNOT = IN = NOTIN = ignore + EQ = NOTEQ = LT = LTE = GT = GTE = IS = ISNOT = IN = NOTIN = \ + MATMULT = ignore # additional node types COMPREHENSION = KEYWORD = FORMATTEDVALUE = handleChildren diff --git a/pyflakes/test/test_other.py b/pyflakes/test/test_other.py index 0ac96a3..ae6cea2 100644 --- a/pyflakes/test/test_other.py +++ b/pyflakes/test/test_other.py @@ -1736,3 +1736,10 @@ class TestAsyncStatements(TestCase): ... await trans.end() ''') + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_matmul(self): + self.flakes(''' + def foo(a, b): + return a @ b + ''') -- cgit v1.2.1