[PEP draft 2] Adding new math operators

Robin Becker robin at jessikat.fsnet.co.uk
Wed Aug 9 16:15:37 EDT 2000


In article <slrn8p3bdg.st.hzhu at rocket.knowledgetrack.com>, Huaiyu Zhu
<hzhu at localhost.localdomain> writes
..
..
>se mul
>
>You have to remember what type each function is accepting and returning, and
>have a mental picture of which part of your program have all matrixwise or
>elementwise objects.
>
>You also end up with expressions like
>
>((a.E*b.E).M*(c.E*d.E).M).E + (x.M*y.M).E  # vs    (a~*b)*(c~*d) ~+ x*y
>                                           # or    (a*b)~*(c*d) + x~*y
...
I agree that the algorithm should know what it's supposed to do, but it
needn't know what you pass it. The alternative doesn't look that nice to
me and still requires fundamental changes to core python.

The real problem is that since you can't be certain what you'll be
passed the only one that works is the explicitly typed version. When
python3000 arrives and you can guarantee the types then one or other of
the alternatives would be possible.
-- 
Robin Becker



More information about the Python-list mailing list