On Wed, 03 Mar 2010 17:06:01 -0800, Chris Rebert wrote: > But yes, internally, Python converted the int to a float before doing > the addition.
[pedantic] To be precise, Python created a *new* float from the int, leaving the original int alone. Because ints and floats are objects, if Python actually converted the int to a float, this would happen: >>> n = 1 >>> m = n >>> x = 2.0 + n >>> print x 3.0 >>> print n 1.0 >>> "abc"[m] Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: string indices must be integers and the world would rapidly be destroyed. Fortunately this does not happen. [/pedantic] -- Steven -- http://mail.python.org/mailman/listinfo/python-list