int x = 42;
printf("%c\n", *(char *) &x);
that is, access the underlying bits which represent a value as if they were of some completely different type. The results are deliberately not standardized and vary with your machine. Python doesn't provide any way to do this; at worst you get a TypeError for a conversion that isn't implemented, or AttributeError for a slot that an object doesn't have.Implicitly parsing strings to produce numbers isn't weak typing, merely reckless and prone to mistakes. Weak typing can corrupt the state of your program so severely that even correct code begins to malfunction.
This, in and of itself, means absolutely nothing. And neither does:
> Implicitly parsing strings to produce numbers isn't weak typing
There is no such thing as a widely accepted, let alone formal, definition for a strong/weak axis, every other guy out there has his own personal definition. What the bloody hell is the point of words for which no two persons share the same definition? No point. None at all. See comment above, it merely marks you as a guy without a clue.
What makes python seem weakly typed to many people is its implicit variable shadowing. So when you do a="hello", a is a str, and can only be used where a str is expected. However, python lets you do: >a="hello" >a=1
at which point a is shadowed to an int.
Dynamic typing has some (not all) of the problems weak typing has, but they are not the same thing
These words, they don't mean jack shit.
> Dynamic typing has some (not all) of the problems weak typing has, but they are not the same thing
Well of course they aren't, for starters "dynamic typing" actually means something.
It might help you to do research, ask clarifying questions, or explain why you think someone is wrong; instead of assuming that anyone saying something you disagree with has no idea what they are talking about.
[0]http://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic%...
When it comes to that precise subject, I happen to have already done so and to know the count rather well. Stupidity is stupidity, even if it's on the python.org wiki.
> or explain why you think someone is wrong
I did so. Twice if not thrice. There is no well-defined and shared — let alone formal — semantics (and meaning) to the strong/weak "axis", every other person has his own pet definition of it[0] and the definitions are quite often incompatible if not downright opposed.
It is therefore garbage and utterly useless to communication.
> instead of assuming that anyone saying something you disagree with has no idea what they are talking about.
It's not "anyone saying something [I] disagree with", just "anyone using the strong/weak axis as if it actually existed".
[0] From "no memory corruption" to "no possible runtime error" through "no UB", "dynamically typed" and all sorts of takes on "no implicit conversions", usually in order to declare one's pet language is "strong" and somebody else's is "weak". I've seen all of C, C++, Python, Javascript, Perl, Java, Tcl, Lua, Smalltalk or Pascal declared both strong and weak by various (usually different) people.