hi everybody
I've written this function to make a list of all of an objects
attributes and methods (not for any reason, I'm just learning)

def list_members(obj)
    l = dir(obj)
    return map(lambda x : eval('obj.'+x), l)

but I get an error saying that obj isn't defined. As I understand it
eval has access to the current local namespace, which does contain
object, so I'm not sure whats going wrong.

ps Im sure there are better ways of doing the above which doesn't call
the eval function, and while I'd be glad to know what it is, I'd still
like to understand why my way isnt working

thanks

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to