proposed language change to int/int==float (was: PEP0238 lament)

Christopher A. Craig com-nospam at ccraig.org
Tue Jul 24 14:35:12 EDT 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Skip Montanaro <skip at pobox.com> writes:

> Hmm...  PEP 240 proposes that numbers matching the regular expression
> '\d*.\d*' be interpreted as rationals.  Thus "0.5" would be interpreted as
> the rational "5/10" (or perhaps reduced to "1/2").  Using this definition of
> rational literal and your coercion semantics, "4**0.5" would yield a float
> instead of an integer or rational.  Why shouldn't an integer or rational
> base be converted to a rational if the exponent is a rational?

Because 5**0.5 cannot be expressed as a rational.

- -- 
Christopher A. Craig <com-nospam at ccraig.org>
When you say "I wrote a program that crashed Windows", people just stare at
you blankly and say "Hey, I got those with the system, *for free*". - Linus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt

iEYEARECAAYFAjtdv+AACgkQjVztv3T8pztNbwCgtgNlOwyvT3YUQj1xo/Wxbvtd
PP4An3JzQGhNWRlsk0SWOTKSXRDNdM2w
=2qB9
-----END PGP SIGNATURE-----




More information about the Python-list mailing list