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

Diez B. Roggisch deets at nospam.web.de
Wed Jun 20 18:09:52 EDT 2007


> 
> Of course I understand the virtue of writing code with good
> doctests, etc. But my question is why we can't get some more
> static typing as well. Given the tools that'll be in Python
> 3.0, that doesn't seem unreasonable to ask.

That is exactly the problem - there is no "some more" static typing. 
There is static typing - or not. You can't have it "just a bit".

You can have type annotations to create guarding statements and then 
allow better optimized code below that - if everything is "safe".

But static analysis that will allow for compiletime typing error checks 
will need _all_ code to be statically typed.

And still not catch all runtime errors, which is basically an instance 
of the halting problem.

The somewhat grumpy response you might have gotten is simply because the 
whole subject has been discussed about a bazillion times - but never 
ever somebody _created_ something that would work. Just asking for it 
with vague ideas how that would create a better world.

Diez



More information about the Python-list mailing list