def __setattr__(self, k, v): if isinstance(v, pp.ParserElement): Grammar.grm[k] = pp.Group(v).setResultsName(k)