strong/weak typing and pointers

JCM joshway_without_spam at myway.com
Wed Nov 3 14:52:24 EST 2004


JCM <joshway_without_spam at myway.com> wrote:
> Gabriel Zachmann <zach at cs.uni-bonn.de> wrote:
>>>  You didn't mention C++. Try this ...
>>>  
>>>     std::string s = "Wow";
>>>     s += 3.141592654; // Perfectly valid
>>>     s = 3.141592654;  // Also valid

>> ah, good example.

>> So, would it be valid to say:
>> the more coercion (or automatic conversion) rules a language has, the
>> weaker the typing?

> If that's what your definition of weak typing is.  The OP seemed to be
> asking about re-interpreting the representation of a value of one type
> as a different type.

Oops--I guess you are the OP.

When people talk about "weak typing" they generally mean either
implicit conversions (or operations on values of different types),
or reinterpreting representations of values as a different type.
The former, in my opinion, is not about weak typing.



More information about the Python-list mailing list