Proposed improved decorator syntax

Christopher T King squirrel at WPI.EDU
Fri Aug 6 09:18:42 EDT 2004


On 6 Aug 2004, Rob Williscroft wrote:

>  wrote in news:mailman.1235.1091753699.5135.python-list at python.org in 
> comp.lang.python:
> 
> > class foo:
> >     def introduceNewFeature(self, someArgument, anotherArgument):
> >         .decorate = [synchronized]
> >         .accepts  = (int, int)
> >         .author   = 'Chris King'
> >         pass # whatever
> > 
> > 
> 
> AIUI it is intended that prefix '.' will be used at some point
> with a 'with'/'using' keyword:
> 
> class Foo:
>   def f( self ):
>    with self:
>     .member = value

Which makes it all the more intuitive (def is acting similar to a with 
block).




More information about the Python-list mailing list