[pypy-dev] Change function closure cell contents
Tin Tvrtković
tinchester at gmail.com
Thu Jul 27 18:10:41 EDT 2017
That seems to work!
I'd just like to add, Armin, that whenever I have a question you are almost
always the first to respond and your replies are always very helpful and
insightful. It is very much appreciated; thank you. :)
On Thu, Jul 27, 2017 at 11:59 PM Armin Rigo <armin.rigo at gmail.com> wrote:
> Hi Tin,
>
> On 27 July 2017 at 16:17, Tin Tvrtković <tinchester at gmail.com> wrote:
> > My question is, what's the easiest/most natural way of changing the
> contents
> > of this closure cell on PyPy?
>
> On PyPy you can do (tested on PyPy2):
>
> cell = g.func_closure[0]
> cell.__setstate__((43,)) # sets the 'cell_contents' attribute to 43
>
>
> Armin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20170727/b029ecee/attachment.html>
More information about the pypy-dev
mailing list