[Types-sig] Why I don't like static types in Python

Paul Prescod paul@prescod.net
Sun, 29 Nov 1998 23:58:10 -0600


Justus Pendleton wrote:
> 
> To catch these kinds of problems is it really necessary to have a static
> typing system or could kjpylint be enhanced so that it could catch these
> kinds of things?  I realize that it probably couldn't catch every possible
> strange case that might arise using Python, but what if it could notice 80%
> of them and on the rest say,
> 
> "There's something strange going on around line 562, you might want to double
> check that you aren't making a mistake there."

The system would not be very usable if every time you ran it it complained
about dozens and dozens of lines of perfectly usable Python code. So you
would probably need to tell it which objects are mutable and may have
arbitrary attributes added to them, which variables can hold multiple
types, and so forth. You'll probably want to put these annotations inline
for simplicity. When you are done, you have an optional static type
system.

 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself.
 http://itrc.uwaterloo.ca/~papresco

Christmas shopping in a T-Shirt? Toto, I have a feeling we 
aren't in Canada anymore.