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

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Aug 16 03:09:54 CEST 2006


Collin Winter wrote:

> @docstring
> @typechecker
> @constrain_values
> def foo(a: {'doc': "Frobnication count",
>            'type': Number,
>            'constrain_values': range(3, 9)},
>        b: {'type': Number,
>             # This can be only 4, 8 or 12
>            'constrain_values': [4, 8, 12]}) -> {'type': Number}

There's another thing that's bothering me about all this.
The main reason Guido rejected the originally suggested
syntax for function decorators was that it put too much
stuff into the function header and obscured the signature.

Now we seem to be about to open ourselves up to the
same problem on an even bigger scale. Who can honestly
say that the above function declaration is easy to read?
To me it looks downright ugly.

--
Greg


More information about the Python-3000 mailing list