Discussion: new operators for numerical computation

Ben Caradoc-Davies bmcd at es.co.nz
Thu Jul 20 18:29:10 EDT 2000


On Thu, 20 Jul 2000 13:05:54 -0500, Travis Oliphant <olipt at mayo.edu> wrote:
>Definining * to be matrixwise should be handled by
>subclassing the generic array (which will be much easier to do
>without breaking compatibility with compiled extension modules in the
>future Numeric).

I agree. Using Python's object capabilities is better than messing with the
grammar. Although I must say the (*) forms are by far the least bad. As far as
I'm concerned, Matlab is a poor example to follow. I've seen a number of people
burnt by the differences between A' (adjoint) and A.' (transpose), for example. 

May I propose a single generalised way to add syntax? In this way, syntax can
be used as appropriate to context, without cluttering the core language.

The fact that APL has been mentioned in this thread is a bad, *bad* sign.

>I'm not sure we should blow our chance to get some useful operators into
>Python by over-reaching...  Also, unless you've used Numeric with Python
>for a while, it's easy to over-value the use of the infix notation.
>This really bugged me when I first started using Numeric Python as
>well, but it doesn't bother me anymore.  The syntax does not have
>to be as bad as Huaiyu demonstrates.  

I wholeheartedly endorse this view.

"Syntactic sugar causes cancer of the semicolon" -- Alan Perlis

One of Python's greatest features is its simplicity. Adding extra syntax
reduces this. I won't mention The Other Language.

Ministry of silly syntax:

(*)   Darth Vader
|*|   Tie Fighter
>+<   X-Wing

-- 
Ben Caradoc-Davies <bmcd at es.co.nz>



More information about the Python-list mailing list