On 03/29/2013 04:27 AM, Peter Otten wrote:
(2)
> import re > > class Matcher: > def __call__(self, expr, line): > result = self.match = expr.match(line) > return result > def __getattr__(self, name): > return getattr(self.match, name)
Perhaps it's a little simpler to do this?
self.match = expr.match(line)
> return self.match -m -- Lark's Tongue Guide to Python: http://lightbird.net/larks/ Frisbeetarianism is the belief that when you die, your soul goes up on the roof and gets stuck. George Carlin -- http://mail.python.org/mailman/listinfo/python-list