PEP0238 lament

Stephen Horne steve at lurking.demon.co.uk
Wed Jul 25 03:26:58 EDT 2001


On Tue, 24 Jul 2001 21:25:34 GMT, Guido van Rossum <guido at python.org>
wrote:

>Hm, IMO the problem is different.  Python's numerical model *almost*
>embeds the integers in the floats.  (They should've been called reals,
>but that mistake is too insignificant to want to fix. :-) In *most*
>situations, where a float is expected, an int works just as well, and
>has the same effect as a float with the same mathematical value.
>Division is the exception and that's where the problem lies.
>
>But the converse is *not* true in today's Python: code expecting
>integers does *not* necessarily work when a float is passed, even if
>that float has an integral value.  This is part of the fabric of
>Python's semantics.

So increasing the odds that discrete integers will be magically
transformed into floats, without that being intended by the
programmer, is a BAD thing, then ;-)




More information about the Python-list mailing list