[Python-Dev] Re: Decorators: vertical bar syntax
David Eppstein
eppstein at ics.uci.edu
Sun Aug 8 09:22:43 CEST 2004
In article <004501c47cdb$355743d0$6602a8c0 at arkdesktop>,
"Andrew Koenig" <ark-mlist at att.net> wrote:
> I like the following variation even better:
>
> def foo() |
> classmethod |
> accepts(int, int) |
> returns(float):
>
> Alternatively,
>
> def foo() | classmethod | accepts(int, int) | returns(float):
>
> Yes, I understand that the first of these would require allowing a newline
> after the | without ending the statement. If it were up to me, I would
> allow a newline to follow any operator, but if that's too radical, then
> allowing newlines between the def and the following : would be fine.
Did you omit the full wink? Or did you forget that | is already a binop?
Strictly speaking I guess it's unambiguous if one doesn't allow
arbitrary expressions as decorators, but...
--
David Eppstein
Computer Science Dept., Univ. of California, Irvine
http://www.ics.uci.edu/~eppstein/
More information about the Python-Dev
mailing list