Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Cell objects and their values

Reply
Thread Tools

Cell objects and their values

 
 
Robert Brewer
Guest
Posts: n/a
 
      04-21-2004
Say I obtain a cell object via:

>>> def f():

.... y = 3
.... def g():
.... return y
.... return g
....
>>> f().func_closure[0]

<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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prophets are honored by everyone, except the people of their hometownand their own family. Eljee Digital Photography 8 09-21-2006 05:35 AM
Since MSN CHAT went pay per use. Is their any other free ones out their Hugh Computer Support 8 05-19-2004 05:52 PM
RE: Cell objects and their values Robert Brewer Python 2 04-22-2004 11:23 AM
What the pros use to power their flashes... and their digital cameras. Dan Sullivan Digital Photography 21 01-04-2004 04:40 PM
Stop Spammers by Hitting Their Servers - Not Their Email. Magic347 Computer Support 27 07-03-2003 04:36 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57