[Python-ideas] Left division operator

Mike Graham mikegraham at gmail.com
Mon Jul 18 03:20:16 CEST 2011


On Sun, Jul 17, 2011 at 6:39 PM, MRAB <python at mrabarnett.plus.com> wrote:
> If there's a reverse division operator, then why not a reverse
> subtraction operator too? Or a reverse modulo operator?

The inspiration was Matlab's \ operator, which comes in handy when you
have a matrix A and a vector b and want to solve "A * x = b". In
Matlab this is spelled "x = A \ b" and in Python with numpy it is
spelled something like numpy.linalg.solve(A, b). This is a fairly
common operation in numerical programs. No similar history and utility
is obvious for these other operators.

That being said, solve(A, b) is fine as far as I can see.

Mike



More information about the Python-ideas mailing list