[Python-ideas] parameter annotation semantics
Greg Ewing
greg.ewing at canterbury.ac.nz
Mon Apr 18 00:57:28 CEST 2011
Bruce Leban wrote:
> @memoize
> @log_me
> def c(foo:{memoize:memo_value(int)}, bar:{log_me:no_log,
> memoize:memo_value(tuple)}):
> pass
>
> but I think that's too verbose and therefore less likely to be adopted.
Seems to me that *any* scheme for attaching multiple annotations
is likely to lead to unreadably verbose function headers. Or even
single annotations, for that matter.
Back when the decorator syntax was being hammered out, one of the
objections to putting the decorator on the same line as the function
header was that it could lead to excessively long and hard-to-read
headers. I think the whole open-slather annotation idea is asking
for the same thing in spades.
--
Greg
More information about the Python-ideas
mailing list