[Python-3000] What's the point of annotations?

Collin Winter collinw at gmail.com
Wed Jan 3 00:48:20 CET 2007


On 1/2/07, Phillip J. Eby <pje at telecommunity.com> wrote:
> At 08:13 PM 1/2/2007 +0100, BJörn Lindqvist wrote:
> >On 1/2/07, Phillip J. Eby <pje at telecommunity.com> wrote:
> >>You left off overloading and argument adaptation as use cases.  These are
> >>considerably more readable when specified in-line, just like decorators are
> >>more readable placed above the function than after it.
>
> >  I'd like to see a before-and-after example.
>
> @overload(int, str)
> def foo(bar, baz):
>      ...
>
> @overload
> def foo(bar: int, baz: str)
>      ...

Is whatever savings you see there worth changing the language for? Is
function overloading really that important and that common?

I'm still not convinced that the language syntax should change to make
life a tiny bit easier for third-party libraries. Not every n-line
function should go in the stdlib or be turned in to syntax.

Thanks,
Collin Winter


More information about the Python-3000 mailing list