A decorator syntax not yet mentioned (I think!)

Nick Craig-Wood nick at craig-wood.com
Fri Aug 13 01:43:56 EDT 2004


Steven Bethard <steven.bethard at gmail.com> wrote:
>  decorate:
>      grammarrule('statement : expression')
>      versioninfo("Added in 2.4")
>      deprecated
>      typeinfo(None)
>  def p_statement_expr(self, p):
>      print p[1]

Has anyone considered overloading one of the existing keywords...
"as" comes to mind as it immediately suggests a naming scheme for the
decorators, "as" "noun" "noun" "noun", eg

 as:
     staticmethod
     grammarrule('statement : expression')
     version("Added in 2.4")
     deprecatedmethod
     type_(None)
 def p_statement_expr(self, p):
     print p[1]

( Actually "as" doesn't appear to be a keyword anyway! )

-- 
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick



More information about the Python-list mailing list