[Python-Dev] Re: Re: Call for defense of @decorators
Florian Schulze
florian.proff.schulze at gmx.net
Sat Aug 7 10:42:16 CEST 2004
On Fri, 06 Aug 2004 11:39:34 -0400, Barry Warsaw <barry at python.org> wrote:
> So I spent a little time futzing with python-mode and some of my
> decorator code, to try some alternative leading characters. Of the ones
> that cannot be used in valid Python code today (i.e. no backward
> compatibility issues), I tried ':', '/', '=', '*', and '|'.
>
> [snipped]
>
> My preference then would be to use = with | and : as alternatives, in
> that order.
Does it really need to be only one character? Would this make the parser
to complicated? If not, I would propose '::' which stands out much more
than ':'
What about '~'?
More:
'|='
'|~'
':~'
':=' - This was brought up as late binding as well:
name := staticmethod(name)
def name(self):
...
'&' - Used for too much else IMO.
Now in context:
::accepts(int,int)
::returns(float)
def bar(low,high):
...
|=accepts(int,int)
|=returns(float)
def bar(low,high):
...
|~accepts(int,int)
|~returns(float)
def bar(low,high):
...
:~accepts(int,int)
:~returns(float)
def bar(low,high):
...
:=accepts(int,int)
:=returns(float)
def bar(low,high):
...
~accepts(int,int)
~returns(float)
def bar(low,high):
...
~~accepts(int,int)
~~returns(float)
def bar(low,high):
...
If all this is not possible, then I +1 for '|'.
|accepts(int,int)
|returns(float)
def bar(low,high):
...
Regards,
Florian Schulze
ps: Just for reference:
@accepts(int,int)
@returns(float)
def bar(low,high):
...
More information about the Python-Dev
mailing list