I think I found a bug in Python 2.6.4 (in the inspect module)

inhahe inhahe at gmail.com
Tue Dec 29 17:22:24 EST 2009


On Tue, Dec 29, 2009 at 5:11 PM, inhahe <inhahe at gmail.com> wrote:
> On Tue, Dec 29, 2009 at 5:10 PM, inhahe <inhahe at gmail.com> wrote:
>>
>> So i'm guessing that the attribute has been changed from func_code to
>> f_code but the inspect module wasn't updated to reflect that.
>>
>
> er i mean from f_code to func_code
>

f_locals doesn't even seem to exist at all.

Traceback (most recent call last):
  File "E:\jsterm\specs\test.py", line 6, in <module>
    print inspect.getargvalues(a)
  File "E:\Python26\lib\inspect.py", line 817, in getargvalues
    return ArgInfo(args, varargs, varkw, frame.f_locals)
AttributeError: 'function' object has no attribute 'f_locals
>>> dir(a)
['__call__', '__class__', '__closure__', '__code__', '__defaults__',
'__delattr__', '__dict__', '__doc__', '__format__', '__get__',
'__getattribute__', '__globals__', '__
hash__', '__init__', '__module__', '__name__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__',
'__sizeof__', '__str__', '__subclasshook__', 'func_clo
sure', 'func_code', 'func_defaults', 'func_dict', 'func_doc',
'func_globals', 'func_name']



More information about the Python-list mailing list