"print int" would be nice

Grant Edwards grante at visi.com
Tue Jan 29 13:11:07 EST 2002


In article <834rl5gmkw.fsf at panacea.canonical.org>, Kragen Sitaker wrote:

>> Is there a reason why python doesn't convert a int to string 
>> automatically? Would be nice this would work:
>> 
>> i=2
>> print "int: " + i
> 
> Python generally does not convert types automatically.  

It does for many numeric types.  I'd probably better off if
Python (and C for that matter) didn't automatically convert
numeric types either, but that would seem a bit radical to many
people.

-- 
Grant Edwards                   grante             Yow!  ... I think I'm
                                  at               having an overnight
                               visi.com            sensation right now!!



More information about the Python-list mailing list