3 ms·
that might be a good idea, or a little strange. many existing python infix boolean operators resolve to method names based on the meaning, rather than the symb
by shoo 13y ago
that might be a good idea, or a little strange.
many existing python infix boolean operators resolve to method names based on the meaning, rather than the symbol. e.g. `a + b` resolves to `a.__add__(b)` rather than `a.__plus__(b)`, `x * * y` resolves to `x.__pow__(y)` rather than `x.__asteriskasterisk__(y)`, say. so arguably it would be consistent to name @ after the common meaning also.
http://docs.python.org/2/reference/datamodel.html#emulating-numeric-types http://docs.python.org/2/reference/datamodel.html#emulating-...
on the other hand, "consistency is not necessarily a virtue: one can be consistently obnoxious" - C.A.B. Smith
that said, i like the idea that @ should be more general than just for matrices. an arbitrary infix boolean operation, neither necessarily commutative nor invertible.
even when talking about matrix multiplication, generalising slightly from arrays to abstract elements of vector spaces, and from matrices to linear transformations between vector spaces leaves you writing the same kinds of expressions that compose linear transformations without anything necessarily being represented as a matrix.