mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +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
|
@ -30,6 +30,14 @@ Number Protocol
|
|||
the equivalent of the Python expression ``o1 * o2``.
|
||||
|
||||
|
||||
.. c:function:: PyObject* PyNumber_MatrixMultiply(PyObject *o1, PyObject *o2)
|
||||
|
||||
Returns the result of matrix multiplication on *o1* and *o2*, or *NULL* on
|
||||
failure. This is the equivalent of the Python expression ``o1 @ o2``.
|
||||
|
||||
.. versionadded:: 3.5
|
||||
|
||||
|
||||
.. c:function:: PyObject* PyNumber_FloorDivide(PyObject *o1, PyObject *o2)
|
||||
|
||||
Return the floor of *o1* divided by *o2*, or *NULL* on failure. This is
|
||||
|
@ -146,6 +154,15 @@ Number Protocol
|
|||
the Python statement ``o1 *= o2``.
|
||||
|
||||
|
||||
.. c:function:: PyObject* PyNumber_InPlaceMatrixMultiply(PyObject *o1, PyObject *o2)
|
||||
|
||||
Returns the result of matrix multiplication on *o1* and *o2*, or *NULL* on
|
||||
failure. The operation is done *in-place* when *o1* supports it. This is
|
||||
the equivalent of the Python statement ``o1 @= o2``.
|
||||
|
||||
.. versionadded:: 3.5
|
||||
|
||||
|
||||
.. c:function:: PyObject* PyNumber_InPlaceFloorDivide(PyObject *o1, PyObject *o2)
|
||||
|
||||
Returns the mathematical floor of dividing *o1* by *o2*, or *NULL* on failure.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue