[Python-Dev] Extended Function syntax

Samuele Pedroni pedronis@bluewin.ch
Thu, 30 Jan 2003 03:53:20 +0100


From: "Jack Jansen" <Jack.Jansen@oratrix.com>
> Hmm, the __name__'s of various builtin types are not exposed in any
> namespace, are they? Otherwise we could say that "def foo():" is really
> a shorthand for "def xxx.function foo():", and maybe even "class Bar:"
> for "def xxx.classobj Bar:"

function have formal parameters which are not a tuple of values computed at
definition time like superclasses for a class, so it seems that both shorthand
cannot be made work at the same time.

reusing 'def' is a possibility for the KEYW-TO-BE in my post, but it's
clear-cut that's the least confusing choice. Unless we go for a generalization
of 'def' (function) instead of 'class' but it would make def property more odd
because property would likely have to receive a code object instead of a
populated dict.