[Python-3000] Function annotations considered obfuscatory (Re: Conventions for annotation consumers)

Jim Jewett jimjjewett at gmail.com
Wed Aug 16 19:03:12 CEST 2006

On 8/16/06, Guido van Rossum <guido at python.org> wrote:
> On 8/16/06, Jim Jewett <jimjjewett at gmail.com> wrote:

> > I hope that needing more than one line per argument will be unusual,
> > but needing more than one line for a definition may not be.

> I expect the latter will be too, as it would only matter for code that
> somehow straddles two or more frameworks.

    >>> def f(position:[int, "negative possible"]): ...

"int" and the comment are both documentation which doesn't really need
any framework.  They are both things I would like to see when
introspecting that particular function, though perhaps not when just
scanning function defs.  Together, they're already long enough that I
would prefer to see any second argument on its own line.

> > That is one reason I wonder whether all annotations/modifications have
> > to actually be part of the prologue, or whether they could be applied
> > to the Signature afterwards.

> And how would that reduce the clutter? The information still has to be
> entered by the user, presumably with the same disambiguating tags, and
> some punctuation.

The summary of a function shows up in its prologue, but the details
span the next several lines (the full docstring and body suite).

My feeling is that when annotations start to get long, they're details
that should no longer be in the summary.


More information about the Python-3000 mailing list