A really bad idea.

Greg Ewing see_reply_address at something.invalid
Mon Nov 18 18:22:33 EST 2002


M wrote:

> Operator overloading. Why should we have it?


For consistency. So that user-defined types have the
same rights and privileges as built-in ones.

 > Just so that you can write vector1 + vector2
 > instead of vector1.add(vector2)?

If you're not heavily into linear algebra you might
not see the value of this, but believe me, it can
make a HUGE difference to the readability of code
that manipulates matrices and vectors a lot. Try
to explain to the Numeric people that they should
enjoy writing matrix1.add(matrix2) all the time
and see how far you get...:-)

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list