On 27/10/2006, at 9:31 PM, Dan Eloff wrote:

On 10/27/06, Graham Dumpleton <[EMAIL PROTECTED]> wrote:
Jim sent this to me when the python-dev list was down for maintenance. Can anyone with Python 2.5 who knows something about function internals
enlighten us about what may have changed here. Previously the names
of nested functions appeared in func_code.co_names but that doesn't
appear to be the case in Python 2.5.

Confirmed. Try func_code.co_varnames instead. I don't know why the
change, and a quick search wasn't very enlightening, other than they
python guys mentioned something about co_names and co_varnames
changed, and some people fixing this problem by using co_varnames in
python 2.5.

Unless they have really screwed things around, co_varnames is specifically
for function argument names and is unlikely to contained nested constant
names. If it did, then I would expect a lot of the publisher code to break in other ways as it uses co_varnames for the very specific purpose of matching
form parameters against function arguments.

I guess time will tell.

Anyway, time for me to sleep. :-)

Graham

Reply via email to