On Fri, Jul 25, 2008 at 12:06 AM, Scott Dial <scott+python-dev at scottdial.com> wrote: > Perhaps I'm nobody, but I think this would be ridiculous. Matrices are > not native objects to the language. There is no type(matrix). The notion > of what makes a Python object a matrix is a convention and to have > built-in operators dedicated to such objects makes no sense. There are > multiple ways to stuff matrices into Python. Please submit a PEP for a > type(matrix) first. Until a matrix is a first-order object in Python, > there is no logic to making operators for them. Though I would personally find a matrix multiplication operator useful, I have to agree with this. Anyway, it is easy to define pseudo-operators in Python; just create an Operator class and implement its __mul__ and __rmul__ methods appropriately (there are recipes for this around somewhere). Then you can define various custom multiplication operators with syntax like this: A *matrixmul* B A *dot* B A *cross* B A *elementwise* B Some other fun possibilities: A +concat+ B A /solve/ B A **left_inverse** (-1) A **right_inverse** (-1) x **tetrate** y n |choose| k Fredrik
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4