On 6/4/2010 7:32 AM, macm wrote:A few types of objects have definition names (.__name__ attribute). All have 0 to many namespace names. If you want to pass an attribute name, pass it -- as a string.
def myDef(x) doSomething x result = x.???? return coolThings
def f(x. x_attr_name): ... res = getattr(x, x__attr_name) ... Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list