the definition of "strong" (was Re: Why isn't Python king of the hill?)

Joshua Marshall jmarshal at mathworks.com
Thu Jun 7 14:20:44 CEST 2001


Steven Haryanto <steven at haryan.to> wrote:
> Sorry for bringing back an oldish post, but how does one define
> "strong typing" and "weak typing" vs "static typing" and "dynamic
> typing"? I've always thought that Python has _strong_ typing,
> but it is not static.

Right.

> So it is unlike Perl which has weak and dynamic typing (although
> under -w Perl will issue warnings if you try to mix string and
> numeric in expressions).

I don't know Perl well, but I think I'd say it also has strong typing.
There is some automatic conversion between strings and numbers, but
this doesn't violate strong typing.  C, on the other hand, is weakly
typed--you can create an instance of one type then cast it and
interpret the same bits in a totally different way.



More information about the Python-list mailing list