[Python-Dev] Re: Re: Re: Decorators: vertical bar syntax

Fernando Perez fperez528 at yahoo.com
Tue Aug 10 00:23:43 CEST 2004

Bob Ippolito wrote:

> On Aug 9, 2004, at 5:50 PM, Fernando Perez wrote:
>> I feel like I've said as much as is reasonable on this topic, so I'll
>> probably
>> shut up and wait for something to happen.  I'll then see if IPython
>> needs
>> fixing to live in a post-decorators world or not, and work accordingly.
> Wouldn't it be reasonable to just change the magic character that
> IPython (and maybe even Leo) uses from '@' to ':', '=', or '/'?   As
> far as I know, it's practically[1] never valid Python to start a line
> with any of these symbols (this list of not definitive, of course).
> '/' has the advantage, for IPython, that it's easy to type (no shift
> involved, at least on my US keyboard) and should be familiar to many
> people as a "command" character from IRC clients, searching in vim and
> less, etc.

Indeed, if @ becomes the decorator character, I'll post to the ipython user/dev
lists and request community feedback.  Any of these is an option, and I've
also considered using %.  Note that in most cases in ipython, you don't really
type the @ character explicitly, since ipython auto-detects magics when there
is no chance of ambiguity.  You only need the explicit @ when you have both a
magic and a variable with the same name.

As I said, this is techincally trivial to fix.  It's just a bunch of busywork,
and it will break user's _habits_.

I'll keep your point of non-shifting characters in mind when the time comes,
thanks for pointing that out.

> [1] It can be done with a backslash line continuation or in a
> multi-line docstring, but I wouldn't really consider that the beginning
> of a line in the practical sense...

For ipython these only make sense in single-lines, so this is not a problem.

Thanks for the feedback.



More information about the Python-Dev mailing list