On 23 Apr 2007, at 05:17, Terry Reedy wrote:
> "Jim Jewett" <[EMAIL PROTECTED]> wrote in
> message
> news:[EMAIL PROTECTED]
> | Functions (including methods) often want access to themselves,
> | usually for a private storage location.
>
> Or for true recursion. At present, a function has to 'hope' that its
> definition name is not rebound.
Indeed. It's much clearing than having to write:
Y = lambda f: partial(f,f)
fac = Y(lambda f, n: n*f(f,n-1) if n>0 else 1)
:-)
Seriously though, while I have to confess never, ever having found
rebinding of function names a limiting factor in writing recursive
code I'm still in favour of the proposal. Personally I think
function-local storage is a more likely use.
+1
Nicko
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com