Adding static typing to Python

Alexander Jerusalem ajeru at vknn.org
Tue Feb 19 21:42:32 EST 2002


Michael Chermside <mcherm at destiny.com> wrote in message news:<mailman.1014129930.16624.python-list at python.org>...
> No discussion of adding static typing to Python would be complete 
> without a reference to Guido's thoughts on the subject:
> 
>     http://www.python.org/~guido/static-typing/index.htm
> 
> I suspect that these may be a bit dated (~2 yrs old), but a few key 
> ideas should still be relevent:
> 
>     * Static typing should be optional.
>     * The 'purpose' of static typing is to ensure that type errors are
>       caught at compile time, not runtime (in checked code).
>     * Don't expect huge performance gains -- catching certain kinds of
>       errors earlier is the main gain.
> 
> Not that I fully agree, or want to tie Guido to old ideas, but those who 
> come to this idea fresh should realize it has been considered before. 
> The main results of the previous consideration are:
> 
>     * Performance isn't really the issue (though people often think it
>       is).
>     * Unit testing could (if used well) catch the same errors that static
>       type checking catches.
>     * Unit testing is a good thing.
>     * Python is a REALLY dynamic language, and one which tends to trust
>       the programmer.
> 
> -- Michael Chermside

That answers my initial question if there is some effort to include
static typing into Python. Thanks. What I miss in the definition of
the purpose is type based dispatching and multi methods. I wonder just
what happened to that type-SIG that's mentioned somewhere.

Alexander



More information about the Python-list mailing list