Perl is worse!
Moshe Zadka
moshez at math.huji.ac.il
Fri Jul 28 07:28:54 EDT 2000
On Fri, 28 Jul 2000, Steve Lamb wrote:
> So I ask you this /VERY/ simple question. Why can't Python do both? Hm?
> What is wrong with taking 1 + "1", converting the "1" to a 1 and adding it
> together? If it is a string that cannot be converted to an integer, throw an
> exception, otherwise, do it. Then that preserves the 1 + "foo" exception and
> also does the sane thing of getting rid of types when it makes sense to do so.
That is the worst thing it could possibly do! You'd have a program that
works fine on testing with your configuration files, and blows up in the
user's face when he makes a typing error.
> Hell, why do an exception at all? Why not do what is already done with
> integers, reals and floats?
Because numbers are numbers and strings are not. Given, Python's numeric
model is not very good. Why should the rest of the language suffer?
--
Moshe Zadka <moshez at math.huji.ac.il>
There is no IGLU cabal.
http://advogato.org/person/moshez
More information about the Python-list
mailing list