[Python-Dev] Re: Decorators: vertical bar syntax (original) (raw)

Andrew Koenig ark-mlist at att.net
Sun Aug 8 02:03:45 CEST 2004


> def foo(): > | classmethod > | accepts(int,int) > | returns(float) >

Thats it! I love it.

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.



More information about the Python-Dev mailing list