All that example shows is the Python is dynamically typed.
The basic story is:
*Static/dynamic refers to the type of variables (and functions): in statically-typed languages, once a variable contains a string, it can never return an int.
*Weak/strong refers to the type of objects: in weakly-typed languages, "1"+1 is allowed (although Java, which is strongly typed, DOES give special allowance for automatic casting to string).
Submitted by Max Rabkin (not verified) on Wed, 21/02/2007 - 09:03.
All that example shows is the Python is dynamically typed.
The basic story is:
*Static/dynamic refers to the type of variables (and functions): in statically-typed languages, once a variable contains a string, it can never return an int.
*Weak/strong refers to the type of objects: in weakly-typed languages, "1"+1 is allowed (although Java, which is strongly typed, DOES give special allowance for automatic casting to string).
Submitted by Max Rabkin (not verified) on Wed, 21/02/2007 - 09:03.