I get class Searcher(object) but can't for the life of me see why (except to be intentionally obtuse) one would use the def searcher(rex) pattern which I assure you would call with searcher(r)(t) right?
- mdf > > > > 'Most flexible' in a different way is > > > > def searcher(rex): > > crex = re.compile(rex) > > def _(txt): > > return crex.search(txt) > > return _ > > > > I see your obfuscatory ante and raise you several dots and > underscores: > > class Searcher(object): > def __init__(self, rex): > self.crex = re.compile(rex) > def __call__(self, txt): > return self.crex.search(txt) > -- http://mail.python.org/mailman/listinfo/python-list