eval function not working how i want it dag namn

Michael Hoffman cam.ac.uk at mh391.invalid
Fri Apr 15 14:48:10 EDT 2005


Peter Otten wrote:
> Michael Hoffman wrote:
> 
>>>def list_members(obj)
>>>l = dir(obj)
>>>return map(lambda x : eval('obj.'+x), l)
>>
>>That works fine for me with Python 2.4.
> 
>>>>x.question = "Are you sure?"

I should clarify. It works fine for me when I've already globally 
assigned obj to something else. D'oh!
-- 
Michael Hoffman



More information about the Python-list mailing list