[PEP draft 2] Adding new math operators

Robin Becker robin at jessikat.fsnet.co.uk
Wed Aug 9 12:45:12 EDT 2000


In article <3991891F.6B054A9 at fft.be>, Gregory Lielens
<gregory.lielens at fft.be> writes
...
>Don't you fear the "backtracking" aspect, i.e. to have to track back the
>code to check the types of A and B, before knowing the operation which
>is perfromed by A 'op' B? 
>I know this is already the case now, for example if A and B are strings,
>A+B is a concatenation instead of an addition...Fair for me in this case
>because I consider string and int to be quite different beasts (sorry
>all perl-lovers :-)), and expect to be able to differentiate them by
>context quite easily...
>However, when making the 'op' behavior differ for two very close classes
>(as array and matrix would obviously be), I think it could be a lot more
>error-prone...Similar (worst?) to the classical "1/2 == 0 (oops - why
>not 0.5?)" which pop up sometimes in this newsgroup...
>
>Greg.

no more than I fear the stuff I already get wrong in matlab/numpy.
-- 
Robin Becker



More information about the Python-list mailing list