def _get_a(self, _type): """ Gets an instance implementing type <_type> """ tmp = self._get_all(_type) ret = pick(tmp) if len(tmp) != 1: self.l.warn(("get_a: %s all implement %s; " + "picking %s") % (tmp, _type, ret)) return ret
def get_a(self, _type): return pick(self.get_all(_type))