[Python-Dev] Extended Function syntax

Samuele Pedroni pedronis@bluewin.ch
Thu, 30 Jan 2003 00:06:10 +0100


From: "Guido van Rossum" <guido@python.org>
> I'd like the new keyword to be more generally useful than just for
> defining property.

the first candidate would be a generalization of 'class' (although that make it
redundant with 'class' and meta-classes) so that

KEYW-TO-BE  kind  name [ '(' expr,... ')' ]  [ maybe [] extended syntax ]:
  suite

would be equivalent to

name =
kind(name-as-string,(expr,...),dict-populated-executing-suite,__doc__=doc-strin
g-in-suite)

so we would have:

class C:

 KEYW-TO-BE property foo:
   ...

the remaining problem would be to pick a suitable KEYW-TO-BE