Arnaud Delobelle: > >>> def bindfunc(f): > ... def boundf(*args, **kwargs): > ... return f(boundf, *args, **kwargs) > ... return boundf
> ...>>> @bindfunc > ... def fac(self, n): > ... return 1 if n <= 1 else n * self(n - 1) > ...>>> fac(5) > 120 This is cute, now I have two names to take care of. Thank you to all the people that have answered. 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. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list