def __str__(self): path = XPathExpr.__str__(self) if self.post_condition: path = '(%s)[%s]' % (path, self.post_condition) return path