[Python-Dev] thunks
Samuele Pedroni
pedronis@bluewin.ch
Tue, 4 Feb 2003 20:51:17 +0100
From: "Gerald S. Williams" <gsw@agere.com>
> Samuele Pedroni wrote:
> > > Can this be extended to allow multiple expressions
> > > to act on the thunk? That capability was in some of
> > > the earlier proposals. [...]
> >
> > this one has nothing to do with def () []
>
> Let me rephrase it, then. It looks like this thunk
> proposal allows:
>
> def func(args):
> code
>
> to be rewritten along the lines of:
>
> func = function_def lambda args:
> code
> but doesn't account for the functionality for which
> "def () []" is being suggested. Can we generalize it
> to account for both forms of def?
It also does not cover class-like defs (thing I have already remarked). Guido
has no bandwidth at the moment, so discussing about it is kind of pointless.
Anyway if your interpretation is right then:
func = compdef(function_def,synchronized) lambda args:
...
.