Skip to content

Commit 9a2698d

Browse files
committed
Merge pull request #56 from pyflakes/matmul
Handle matrix-multiplication operator ("@")
2 parents 8d80642 + e8a5c67 commit 9a2698d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pyflakes/checker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,8 @@ def ignore(self, node):
767767
# same for operators
768768
AND = OR = ADD = SUB = MULT = DIV = MOD = POW = LSHIFT = RSHIFT = \
769769
BITOR = BITXOR = BITAND = FLOORDIV = INVERT = NOT = UADD = USUB = \
770-
EQ = NOTEQ = LT = LTE = GT = GTE = IS = ISNOT = IN = NOTIN = ignore
770+
EQ = NOTEQ = LT = LTE = GT = GTE = IS = ISNOT = IN = NOTIN = \
771+
MATMULT = ignore
771772

772773
# additional node types
773774
COMPREHENSION = KEYWORD = FORMATTEDVALUE = handleChildren

pyflakes/test/test_other.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,3 +1736,10 @@ async def commit(session, data):
17361736
...
17371737
await trans.end()
17381738
''')
1739+
1740+
@skipIf(version_info < (3, 5), 'new in Python 3.5')
1741+
def test_matmul(self):
1742+
self.flakes('''
1743+
def foo(a, b):
1744+
return a @ b
1745+
''')

0 commit comments

Comments
 (0)