mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
PEP 465: a dedicated infix operator for matrix multiplication (closes #21176)
This commit is contained in:
parent
2aad6ef774
commit
d51374ed78
42 changed files with 803 additions and 442 deletions
|
@ -91,7 +91,7 @@ module Python
|
|||
|
||||
boolop = And | Or
|
||||
|
||||
operator = Add | Sub | Mult | Div | Mod | Pow | LShift
|
||||
operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift
|
||||
| RShift | BitOr | BitXor | BitAnd | FloorDiv
|
||||
|
||||
unaryop = Invert | Not | UAdd | USub
|
||||
|
|
|
@ -98,6 +98,7 @@ const char *_PyParser_TokenNames[] = {
|
|||
"DOUBLESLASH",
|
||||
"DOUBLESLASHEQUAL",
|
||||
"AT",
|
||||
"ATEQUAL",
|
||||
"RARROW",
|
||||
"ELLIPSIS",
|
||||
/* This table must match the #defines in token.h! */
|
||||
|
@ -1131,7 +1132,7 @@ PyToken_OneChar(int c)
|
|||
case '}': return RBRACE;
|
||||
case '^': return CIRCUMFLEX;
|
||||
case '~': return TILDE;
|
||||
case '@': return AT;
|
||||
case '@': return AT;
|
||||
default: return OP;
|
||||
}
|
||||
}
|
||||
|
@ -1207,6 +1208,11 @@ PyToken_TwoChars(int c1, int c2)
|
|||
case '=': return CIRCUMFLEXEQUAL;
|
||||
}
|
||||
break;
|
||||
case '@':
|
||||
switch (c2) {
|
||||
case '=': return ATEQUAL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return OP;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue