PEP0238 lament

Justin Sheehy justin at iago.org
Sun Jul 22 16:53:28 EDT 2001


sill at optonline.net (Rainy) writes:

> 1/2 is 0. You have to type 1.0/2 to get 0.5. No, there is no good
> reason for that, just memorize it. Ugh.

Of course there is a good reason for it.

It may not be a reason that you personally think is "good enough", but
that does not make it a random, arbitrary aspect of the language.

You don't have to memorize that 1/2 is zero.  You just have to learn
the general rule here, that division of two integers produces an integer.

Whether or not you like this feature, presenting it as you have is
incorrect and unfair.

-Justin

 






More information about the Python-list mailing list