not safe at all

Christopher L Spencer clspence at one.net
Sat Jul 14 05:24:04 EDT 2001


<sigh>  This is what I get for posting at 5:00 in the morning.
What I MEANT to say was this:
x=getsomestringfromparameterfile()
x=int(x)

	Note that I will probably read a hundred corrections from
people who replied to my original stupidity rather than reading
through the thread first...

Chris.

PS: Despite my own sleep-deprived stupidity, I still maintain that if
you are afraid of dynamic typing, you should stick to Pascal.

On 14 Jul 2001 04:12:05 -0500, Christopher L Spencer
<clspence at one.net> wrote:

>I often have to do this:
>x=getsomestringfromparameterfile()
>x=string(x)
>
>	I consider this to be an advantage of Python.  If you are not
>skilled enough to use this feature, then I'd suggest you stick with
>Pascal.
>
>Chris.
>
>On Fri, 13 Jul 2001 07:32:28 GMT, Dennis Roark <denro at earthlink.net>
>wrote:
>
>>For amusement, run this little script which demonstrates a
>>near ultimate in the lack of type safety in the language.
>>(Perhaps there is a bit of type safety in that you can't do
>>this:  4 + "one") But look at what you can do in the
>>following script:
>>
>>x = 3
>>x = x + 2
>>print "x =", x
>>x = "now I'm a string"
>>print x
>>x = [ 5, x ]
>>print "and now a list:", x
>>
>>If you don't believe it, run it.  Should any language allow
>>x to be such a chameleon, to where it can even be a
>>different type on two sides of an assignment?	
>>---------------------------------
>>Dennis Roark
>>Dept. of Computer Science
>>University of Sioux Falls
>>
>>Starting Points:  http://home.earthlink.net/~denro
>>---------------------------------




More information about the Python-list mailing list