Type signature

Yacao Wang yacaowang at gmail.com
Sat Jul 22 17:50:50 EDT 2006


Hi, I'm a newbie to Python. I've recently read some books about this
language and none of them have answered my question.
As a dynamically-typed language Python doesn't need any form of type
signature which makes the syntax very clean and concise. However, type
signatures are not only a kind of information provided for the compiler, but
also for the programmer, or more important, for the programmer. Without it,
we have to "infer" the return type or required agument types of a function,
and this can't be done without seeing the implementation of it, and
sometimes it is still difficult to extract the above information even if the
implementation is available. Haskell can also determine type information
dynamically, but it still supports and recommends the programming style with
type signatures, which makes the code very readable and maitainable. As I
understand, Python relies too much on run-time type-checking, that is,
whenever you give the wrong type, you just end up with an exception, which
is logically correct, but not that useful as type signatures.
Any ideas on this issue?

-- 
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060722/d2c669cb/attachment.html>


More information about the Python-list mailing list