Nested scopes, and augmented assignment

Bruno Desthuilliers onurb at xiludom.gro
Fri Jul 7 08:47:01 EDT 2006


Fredrik Lundh wrote:
> Bruno Desthuilliers wrote:
> 
>> Certainly not. Nested scopes allow closures, which allow decorators and
>> lot of *very* useful things.
> 
> 
> decorators can be trivially implemented as classes, of course.  it's a
> bit unfortunate that many people seem to think that decorators *have* to
> be implemented as nested functions, rather than arbitrary callables.

Your of course right - and I should know better since AFAIK (IOW please
correct me if I'm wrong), closures and classes are somewhat
interchangeable.

OTHO, using closures can make things far more simple - just like having
functions being objects is not absolutely necessary for having HOF-like
features, but can make HOF much more simple. If you take back all these
kind of features from Python, you end up with something that's not
really better than Java - and then me run away screaming !-)

Thanks for the correction anyway.
-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list