Static Typing in Python

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Tue Mar 16 05:06:31 EST 2004


Premshree Pillai wrote:
>  --- Joe Mason <joe at notcharles.ca> wrote: > In article
> 
> <mailman.11.1079347355.12241.python-list at python.org>,
> 
>>Premshree Pillai wrote:
>>
>>>Err...you probably have the wrong idea of static
>>>typing, I think. Static typing has to do with
>>>explicit
>>>declaration (initialization) of variables (and not
>>>of
>>>variable types). Like in C, C++, etc, Python too
>>>is

>>Is that an official definition from somewhere? 
>>Cause I always thought
>>static typing was about variable types.
>>
> 
> Hmm...I might have been a little wrong there. However,
> what I wanted to stress was that it's the explicit
> declaration of the variable that matters (that makes
> static typing what it is).
> 
Try OCaml (or any ML language) or Haskell and say it again !-)
Please replace 'static' with 'compile-time' and 'typing' with 
'type-checking' and you'll understand that static typing and explicit 
variables declaration are two different (albeit somewhat related for 
most mainstream languages) concepts.


(Now, what you ask for is explicit variables declaration. This does not 
exist in Python, except for the slots thing in new-style classes.)

Bruno




More information about the Python-list mailing list