On Oct 25, 10:00 pm, "David S." <[EMAIL PROTECTED]> wrote: > Does something like operator.getattr exist to perform a chained attr > lookup?
Do you mean something like
class cattrgetter:
def __init__(self, name):
self.names = name.split('.')
def __call__(self, obj):
for name in self.names:
obj = getattr(obj, name)
return obj
?
--
http://mail.python.org/mailman/listinfo/python-list
