PEP 3107 and stronger typing (note: probably a newbie question)

Roy Smith roy at panix.com
Tue Jul 3 13:53:54 CEST 2007


aleax at mac.com (Alex Martelli) wrote:
> Eckel's and Martin's well-known essays on why good testing can replace
> strict static type checking:
> <http://www.mindview.net/WebLog/log-0025>
> <http://www.artima.com/weblogs/viewpost.jsp?thread=4639>

I've read the first before.  I just re-read it.  There seem to be three 
different concepts all being talked about at the same time.

1) Static vs. dynamic checking.
2) Type (is-a) checking vs. behavior (has-a) checking.
3) Automatic (i.e. compiler generated) vs. manually written tests.

They all allow you to write manual tests.  No sane programmer will rely 
exclusively on the automatic checks, no matter what flavor they are.  The 
interesting thing is that most people seem to conflate items 1 and 2 above 
into two composite camps: static type checking vs. dynamic behavior 
checking.  There's really no reason you can't have dynamic type checking 
(things that raise TypeError in Python, for example, or C++'s 
dynamic_cast).  There's also no reason you can't have static behavior 
checking (Java's interfaces).



More information about the Python-list mailing list