Modifying func_closure

Jacek Generowicz jacek.generowicz at cern.ch
Thu Jul 8 10:01:08 EDT 2004


Python's closures are read-only. But is there a way of hacking one's
way around this restriction?

The funct_closure attribute is read-only, so I can't rebind it. It's a
tuple, so I can't mutate it. Even if I could, I can't instantiate cell
ojects. The cell objects don't seem to have any interesting attributes
that one might use to mutate the contents.

Looks hopeless, but maybe someone knows better.



More information about the Python-list mailing list