newbie str to int

Erik Max Francis max at alcyone.com
Tue Oct 2 00:18:49 EDT 2001


James wrote:

> Why doing simple thing like this is so complicated ?
> 
> Perl
> $foo = '123abc' + 0;
> 
> Please explain in newsgroup.

Because Perl is very sloppy with types, whereas Python is not.  The
difference in practice is that Python is more restrictive and catches
problems earlier, whereas with Perl you have to explicitly test for
failure cases yourself.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Man is a hating rather than a loving animal.
\__/ Rebecca West
    The laws list / http://www.alcyone.com/max/physics/laws/
 Laws, rules, principles, effects, paradoxes, etc. in physics.



More information about the Python-list mailing list