Against PEP 240

Alex Martelli aleaxit at yahoo.com
Tue May 29 12:05:11 EDT 2001


"Robin Becker" <robin at jessikat.fsnet.co.uk> wrote in message
news:Ae4BQuAFb6E7Ew0t at jessikat.demon.co.uk...
> In article <9f03m401qcu at enews2.newsguy.com>, Alex Martelli
> <aleaxit at yahoo.com> writes
>
> Well OK I accept that BCD has been used. I also in a distant past used
> snobol, spitbol, pl/1 and similar. I defy anyone to claim that cobol
> ever had a significant impact on thought. Of course I should wear more
> flameproof clothes.

Nah, you're lucky that Admiral Grace Murray-Hopper is not
of this world any more -- or else, over-90 or not, she
would no doubt have given you a piece of her mind... she
lived by her motto "It's easier to ask forgiveness than
permission".  She co-developed both Univac and COBOL, btw.

By making programming (perceived as) safe for corporations,
Cobol probably did more to impact thought than anything
before Basic.  Thought (superstructure) depends on economic
reality (infrastructure) at least as much as vice-versa.


> Floating point is what it says floating point. I don't use commas. As

Why, you used several in the previous paragraph ("snobol, spitbol"
etc).  And what does the first sentence mean?  We're talking
about whether 7.35 should mean what it LOOKS like it means
(7.35, aka 735/100) or rather 7.3499999999999996 (or whatever).
What, in the literal 7.35, shows or suggests that the point
should "float" (and in binary, yet, though the notation is
in decimal)...?


> My main objection is that this is likely to bust just about any
> extension that uses floating point.

Why would a Python literal 7.35 (rather than, as you'd like, 7.35R)
mean rational, and (say) 7.35f (rather than 7.35) mean floating
point have any effect on an extension?  Unless that extension does
(the equivalent of) an eval or exec of some string, I don't see
what Python literal notation matters to extensions.

I'm not saying PEP 240 is perfect in every respect.  I'm arguing
the very specific issue: once we DO have a simpler-to-use, albeit
computationally-slower, non-integral-type alternative to floating
point, should unadorned literals such as 7.35 indicate the simpler
type, OR should adornment be required to get the simpler type
while the default remains floating-point?  I claim the former
resolution would be preferable (apart from issues of compatibility
with existing code), because "casually written" (so to speak)
code should ideally not (it seems to me) get mired in the
potential complexities and difficulties of floating-point:
one should have to EXPLICITLY request floating-point, thus
asserting one knows what one's doing, to get it.


> I'm not against using rationals. They will be slower and I'll have to
> worry about that. I'll be happy if the numerical types PEP allows me
> eventually to get an interval arithmetic together and or do some proper

Can't you do interval arithmetic today, btw?  Quite apart from
the issue of what a literal 7.35 means?


Alex






More information about the Python-list mailing list