Cell objects and their values

R

Robert Brewer

Say I obtain a cell object via:
.... y = 3
.... def g():
.... return y
.... return g
....
<cell at 0x011787F0: int object at 0x002F9320>

Is there a way to get the value of the int (f.y) which is referenced by
the cell, without inspecting (or even having a reference to) f? That is,
using only the object "g()" and its attributes, I'd like to obtain the
same value for LOAD_DEREF that the interpreter does; in the same way
that I can access g.func_globals, I'd like something similar to
"g.func_cellvars" (not just the names as in g.func_code.co_cellvars, but
the values)...


Robert Brewer
MIS
Amor Ministries
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top