On 31 August 2011 17:45, Travis Parks <jehugalea...@gmail.com> wrote:
> I was a little disappointed the other day when I realized that
> closures were read-only. I like to use closures quite a bit.
>
> Can someone explain why this limitation exists? Secondly, since I can
> cheat by wrapping the thing being closure-ified, how can I write a
> simple wrapper that has all the same members as the thing (decorator),
> that then applies them to the underlying thing?

I don't understand.  Can you give an example?

> I also like partial function application. What is the easiest way of
> achieving this in Python? Would it look something like this:
>
> def foo(x, y):
>    return x + y
>
> xFoo = lambda y: foo(10, y)

from functools import partial

foo10 = partial(foo, 10)

HTH

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

Reply via email to