diff options
Diffstat (limited to 'Include')
-rw-r--r-- | Include/Python-ast.h | 6 | ||||
-rw-r--r-- | Include/abstract.h | 12 | ||||
-rw-r--r-- | Include/object.h | 3 | ||||
-rw-r--r-- | Include/opcode.h | 3 | ||||
-rw-r--r-- | Include/token.h | 13 | ||||
-rw-r--r-- | Include/typeslots.h | 2 |
6 files changed, 30 insertions, 9 deletions
diff --git a/Include/Python-ast.h b/Include/Python-ast.h index 67d677b..37e9a60 100644 --- a/Include/Python-ast.h +++ b/Include/Python-ast.h @@ -15,9 +15,9 @@ typedef struct _slice *slice_ty; typedef enum _boolop { And=1, Or=2 } boolop_ty; -typedef enum _operator { Add=1, Sub=2, Mult=3, Div=4, Mod=5, Pow=6, LShift=7, - RShift=8, BitOr=9, BitXor=10, BitAnd=11, FloorDiv=12 } - operator_ty; +typedef enum _operator { Add=1, Sub=2, Mult=3, MatMult=4, Div=5, Mod=6, Pow=7, + LShift=8, RShift=9, BitOr=10, BitXor=11, BitAnd=12, + FloorDiv=13 } operator_ty; typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty; diff --git a/Include/abstract.h b/Include/abstract.h index 6e850b8..db70f21 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -658,6 +658,12 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ o1*o2. */ + PyAPI_FUNC(PyObject *) PyNumber_MatrixMultiply(PyObject *o1, PyObject *o2); + + /* + This is the equivalent of the Python expression: o1 @ o2. + */ + PyAPI_FUNC(PyObject *) PyNumber_FloorDivide(PyObject *o1, PyObject *o2); /* @@ -832,6 +838,12 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ o1 *= o2. */ + PyAPI_FUNC(PyObject *) PyNumber_InPlaceMatrixMultiply(PyObject *o1, PyObject *o2); + + /* + This is the equivalent of the Python expression: o1 @= o2. + */ + PyAPI_FUNC(PyObject *) PyNumber_InPlaceFloorDivide(PyObject *o1, PyObject *o2); diff --git a/Include/object.h b/Include/object.h index 7584d4c..f3c87eb 100644 --- a/Include/object.h +++ b/Include/object.h @@ -275,6 +275,9 @@ typedef struct { binaryfunc nb_inplace_true_divide; unaryfunc nb_index; + + binaryfunc nb_matrix_multiply; + binaryfunc nb_inplace_matrix_multiply; } PyNumberMethods; typedef struct { diff --git a/Include/opcode.h b/Include/opcode.h index 0936f2d..9e5f0bf 100644 --- a/Include/opcode.h +++ b/Include/opcode.h @@ -20,6 +20,9 @@ extern "C" { #define UNARY_INVERT 15 +#define BINARY_MATRIX_MULTIPLY 16 +#define INPLACE_MATRIX_MULTIPLY 17 + #define BINARY_POWER 19 #define BINARY_MULTIPLY 20 diff --git a/Include/token.h b/Include/token.h index 905022b..2b213ee 100644 --- a/Include/token.h +++ b/Include/token.h @@ -58,13 +58,14 @@ extern "C" { #define DOUBLESTAREQUAL 46 #define DOUBLESLASH 47 #define DOUBLESLASHEQUAL 48 -#define AT 49 -#define RARROW 50 -#define ELLIPSIS 51 +#define AT 49 +#define ATEQUAL 50 +#define RARROW 51 +#define ELLIPSIS 52 /* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */ -#define OP 52 -#define ERRORTOKEN 53 -#define N_TOKENS 54 +#define OP 53 +#define ERRORTOKEN 54 +#define N_TOKENS 55 /* Special definitions for cooperation with parser */ diff --git a/Include/typeslots.h b/Include/typeslots.h index ad3cdfb..da2e87c 100644 --- a/Include/typeslots.h +++ b/Include/typeslots.h @@ -74,3 +74,5 @@ #define Py_tp_members 72 #define Py_tp_getset 73 #define Py_tp_free 74 +#define Py_nb_matrix_multiply 75 +#define Py_nb_inplace_matrix_multiply 76 |