[Python-Dev] PEP 318: Decorators last before colon

Barry Warsaw barry at python.org
Thu Apr 1 10:19:53 EST 2004


On Thu, 2004-04-01 at 08:43, Skip Montanaro wrote:

> IN this case there are other practical proposals on the table, not the least
> of which is the status quo.

So I hacked up python-mode a bit to support the syntax coloring of
Guido's previously MFS (most favored syntax).  I wanted to see if the
concerns about visual obscurity were real or not.  Then I rewrote a few
methods of mine that would benefit from decorators (with some
elaboration).  A screen shot of my XEmacs buffer is here:

http://barry.warsaw.us/xemacs.png

Now, I'm sure most of you will hate my color scheme, but I'm used to it
so for me, the decorator stands out perfectly fine.  I'd have no problem
supporting decorator-before-colon and vastly prefer it to
decorator-before-def.

You can play with this yourself by checking out the latest version of
python-mode.el (from sf.net/projects/python-mode).  Note that you won't
get the nice colorization on multiline decorators on the fly because
XEmacs doesn't handle as-you-type font-locking across newlines well. 
Re-fontifying the buffer will pick up the right colors though.

-Barry





More information about the Python-Dev mailing list