bearophileh...@lycos.com wrote:

Another possible syntax:

def fact(n):
    return 1 if n <= 1 else n * return(n - 1)

But I guess most people don't see this problem as important&common
enough to justify changing the language.

Actually, I would like a way to refer to the current function from inside a function. but I would like support in the language, so that the compiler patched the code after the function object is created to directly refer to the function object (or can the code object call the code object?) without any name lookup at all. [An possible objection to doing this is that the code might no longer be valid if used to make another function object, but I think this is so rare at to hardly worry about.] Your initial post seemed to be about a hackish work around that looked to me to make as much trouble as it saves. So I did not respond.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to