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

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Wed Jun 27 16:03:39 CEST 2007


Stephen R Laniel a écrit :
> On Wed, Jun 27, 2007 at 01:44:17PM +0200, Bruno Desthuilliers wrote:
>> Indeed - static typing is for compilers, not for programmers.
> 
> When done well, static typing helps the programmer

The closer thing to "well done static typing" I know is type inference 
(à la O'Caml). And I don't find it that helpfull to the programmer - 
here again, it's mainly to allow compile-time optimizations.

(snip)
> The example toward the end of how ML actually spots an
> infinite loop at compile time seems to me to be "for
> programmers" rather than "for compilers."

It's been a long time since I last got into such a problem. Which BTW 
was very quickly spotted and fixed. Compared to what I would loose, I 
don't think this kind of "help" is so useful.

Stephen, you may not know yet, but Python is *dynamic*. This defeats 
almost all compile-time checking. Of what help would type inference be 
when you can dynamically add/remove/replace attributes (including 
methods and class) at runtime ?



More information about the Python-list mailing list