co_freevars question

R

Robert Brewer

Playing around with func_code objects today, I typed:
()

I would have expected co_freevars to be ('y', ) rather like:
[k for k in f.func_globals if k in f.func_code.co_names and k not in
f.func_code.co_varnames]
['y']

What am I misunderstanding? Under what circumstances does co_freevars
actually possess any items?


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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top