[Python-Dev] Decorators: vertical bar syntax

Mark 'Kamikaze' Hughes kamikaze at kuoi.asui.uidaho.edu
Mon Aug 9 02:25:56 CEST 2004


Sat, Aug 07, 2004 at 12:35:17AM -0400 in <41145C05.1020501 at gradient.cis.upenn.edu>,
Edward Loper <edloper at gradient.cis.upenn.edu> spake:
>The new "vertical bar" syntax was proposed recently, and has gotten
>almost unanimously positive feedback.  In particular, of 17 responses
>to the syntax, only one has been negative (see table, below).
>I'm including both of the following variants:
>    |classmethod
>    |accepts(int, int)
>    |returns(float)
>    def foo(arg1, arg2):
>        ...
>    def foo(arg1, arg2):
>        |classmethod
>        |accepts(int, int)
>        |returns(float)
>        ...
>(I prefer the second, but would be happy with either.)
>The one negative comment was that "|" can look similar to "I" or "l",
>depending on the font; but it's only an issue for some fonts, and it
>should be largely mitigated by syntax-highlighting.
>So I wanted to see if anyone has anything *negative* to say about this
>syntax (or one of its variants).  If possible, please respond by
>updating the wiki, rather than by email.  This syntax is listed under
>H (pre-def) and E2 (post-def).  You will need to sign in before you
>can edit the wiki.
>    Wiki: <http://www.python.org/cgi-bin/moinmoin/PythonDecorators>

  -1.  I think vbar-before is an extremely hard syntax to read, and
vbar-after is extremely misleading (but I don't like where docstrings
are, either).  Wiki updated.

-- 
 <a href="http://kuoi.asui.uidaho.edu/~kamikaze/"> Mark Hughes </a>
"Doing the impossible makes us mighty." -Captain Malcolm Reynolds, Firefly


More information about the Python-Dev mailing list