Once Python got nested scoping, 'class' became redundant. It's a nuisance not just because of all the selves: say you started with
def make_window(x1, x2):
lo, hi = sorted((x1, x2))
def window(x): return lo <= x <= hi
return window
and decided to give the window a custom repr. You could write window.__repr__ = lambda: '<%s..%s>' % (lo, hi)
but this sort of thing gets less fun the further you take it. So you actually rewrite all of this code with 'self' and '__init__' and it gets much longer and if you're me you conceive an antipathy to classes. What I wish you could write is def make_window(x1, x2):
lo, hi = sorted((x1, x2))
def window:
def __call__(x): return lo <= x <= hi
def __repr__(): return '<%s..%s>' % (lo, hi)
return window
BTW, 'foo hell' is too strong a term for most real foo in programming -- we don't need more encouragement to split into warring tribes.