On Oct 25, 10:00 pm, "David S." <davidsch... at alumni.tufts.edu> 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
?