strong/weak - dynamic/static [Was: Getting started]

Skip Montanaro skip at pobox.com
Thu Sep 19 10:35:54 EDT 2002


    Mark> I don't have any practical use for the following, but it seems to
    Mark> demonstrate that what you said is not true...

    [ snip bit about setting __class__ ]

That doesn't make Python weakly typed.  You have to be explicit about the
change.  An example of weak typing would be 

    a = "3.14159" + 7

Python raises a TypeError exception because it doesn't allow you to (can't
concatenate strings and ints or quietly coerce strings to numbers and
perform addition).  Perl, assigns the floating point value 10.14159 to a.

-- 
Skip Montanaro - skip at pobox.com
The need for gutters to be cleaned is directly proportional to how hard it
happens to be raining at the moment.




More information about the Python-list mailing list