[Python-ideas] make __closure__ writable

Joao S. O. Bueno jsbueno at python.org.br
Fri Mar 16 19:19:28 CET 2012


On 16 March 2012 14:57, Yury Selivanov <yselivanov.ml at gmail.com> wrote:
> Can we make the __closure__ attribute writeable?  Since __code__ already is,
> and it is possible to tackle with the opcodes, having no way of rewriting
> __closure__ (except creating a completely new function) is annoying.
>
> I don't think it will somehow harm python, as those who want to break it can
> do it already in multiple ways, easier than playing with __closure__.

+1

This could lead to "flatter" code in a lot of places, where the only way
to have the code behave in certain ways is to write nested functions and
class declarations.

> -
> Yury



More information about the Python-ideas mailing list