[Python-Dev] PEP 246: lossless and stateless
Guido van Rossum
gvanrossum at gmail.com
Fri Jan 14 02:52:10 CET 2005
> Then, Guido's 'Optional Static Typing',
>
> def f(X: Y):
> pass
>
> would be equivalent to
>
> def f(X):
> X = adapt(Y, True, True)
>
> In other words, while calling adapt directly would allow for any adapter;
> using the 'Static Typing' short-cut one would be asking for adapters
> which are both stateless and lossless. Since __conform__ and __adapt__
> would sprout two new arguments, it would make those writing adapters
> think a bit more about the kind of adapter that they are providing.
This may solve the curernt raging argument, but IMO it would make the
optional signature declaration less useful, because there's no way to
accept other kind of adapters. I'd be happier if def f(X: Y) implied X
= adapt(X, Y).
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list