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

Paul Rubin http
Wed Jul 4 12:52:37 EDT 2007


Bruno Desthuilliers <bruno.42.desthuilliers at wtf.websiteburo.oops.com> writes:
> Because static type checks impose a lot of arbitrary restrictions,
> boilerplate code etc, which tends to make code more complicated than
> it needs to be, which is a good way of introducing bugs that wouldn't
> have existed without static type checks. 

Why do you say that?  By metrics and anecdotal evidence, Haskell code
appears to be at least as compact as Python code.

> Depending on the application domain and some technical and
> non-technical constraints and requirements, it (often) happens that
> it's better to have the application deployed now with an occasional
> error message than to have it next year...

I suppose that includes the thing I'm currently working on.  For
some other stuff I've done, such errors would have caused huge hassles,
lost customer money, etc.  

> And FWIW, when it comes to "weird piece of input data", statically
> typed languages are not specially better than dynamic ones...

I know that ML gives compiler warning messages if you have a pattern
match (sort of a variant of a case statement, not a regexp match)
which is non-exhaustive.  And Haskell's Maybe monad is part of an
idiom that handles failing computations (like regexp matches) much
more gracefully than Python can.  Both of those would help this
situation.



More information about the Python-list mailing list