On Thu, Jul 22, 2010 at 10:21 PM, geremy condra firstname.lastname@example.org wrote:
I would also argue that the more valid comparison would be nested functions or classes- both perfectly pretty constructs on their own- which would cause me to gnaw on otherwise unoffending office furniture if I encountered them nested 3 deep.
I guess you're not much fond of decorators then; it's common to define them exactly as 3-level deep nested functions:
def decofactory(deco_arg): def decorator(func): def wrapper(*args, **kwargs): if deco_arg: return func(*args, **kwargs) return wrapper return decorator
@decofactory(n) def func(x, y): ...