On Jan 28, 4:31 pm, John Nagle <[EMAIL PROTECTED]> wrote:
> Arnaud Delobelle wrote:
[...]
> > Note that annotations do not provide explicit typing, AFAIK:
>
> > def f(x:int) -> int: return x*2
>
> > is stricly equivalent to
>
> > def f(x): return x*2
> > f.__annotations__ = {'x':int, 'return':int}
>
> > You still need to write a type-checking wrapper.
>
> Unenforced static typing is somewhat pointless. If that
> goes in, it should be enforced by implementations. Otherwise,
> maintenance programmers can't trust the type information they see.
(As discussed earlier, there is no static typing in Python, there can
only be runtime type-checking or, as someone called it, "explicit
typing")
I think the idea is to let the user decide how to enforce type-
checking, not the language. I suppose if in a few years a way to do
it emerges that is "the best", then it'll make its way into the
standard library...
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list