Against PEP 240

Alex Martelli aleaxit at yahoo.com
Tue May 29 17:44:38 EDT 2001


"Robin Becker" <robin at jessikat.fsnet.co.uk> wrote in message
news:XLHUlFB4W$E7EwGh at jessikat.fsnet.co.uk...
    ...
> >Why should those that want correct answers pay the syntactic price
> >rather than those that want performance?
>
> tradition, consistency with other languages that are used for floating
> point arithmetic.

Tradition and intra-language consistency point in different directions
depending on what other languages you're considering.  Besides, I
have oodles of code in languages "used for floating point arithmetic"
that's FULL of decorated literals to specify single-precision or double
precision -- it seems quite traditional for floating-point fans to decorate
their literals with tasteful 'd', 'e', and/or 'f', not to speak 'l'
sometime.


> If we're forced to use 'f' or 'F' I don't mind. We can do double
> precision in the same way ie use 'D'.

That's no different from Pep 240 as I recall it, so why did you
start this thread against it?  7.35F, or whatever, can specify
floating-point with its little tasteful decoration.  Just leave plain
7.35 to the masses who don't WANT it to actually mean
7.3499999999999996, or whatever, but 7.35 exactly...


> The exponentiation notation can then be used by both rationals and
> floats.

I'd LOVE to be able to write 1e8 to mean 100000000, an int, rather
than having to count zeros... but that may be because of the lira's
notoriously low value, and in a bit more than 6 months we're gonna
switch over to Euros worth 1936.27 liras, so the need may abate:-).

> Are complex numbers, floats and rationals and ints to be freely mixable?

I don't see why numeric types should be any less mixable if/when
PEP 240 takes over than they are now.


Alex






More information about the Python-list mailing list