def __eq__(self, other): """ @return: true if this C{CFGProduction} is equal to C{other}. @rtype: C{boolean} """ return (_classeq(self, other) and self._lhs == other._lhs and self._rhs == other._rhs)
def __eq__(self, other): """ @return: True if this non-terminal is equal to C{other}. In particular, return true iff C{other} is a C{Nonterminal} and this non-terminal's symbol is equal to C{other}'s symbol. @rtype: C{boolean} """ return (self is other or _classeq(self, other) and self._symbol == other._symbol)
def __eq__(self, other): return (_classeq(self, other) and self._lhs == other._lhs and self._rhs == other._rhs and self.prob() == other.prob())
def __cmp__(self, other): if not _classeq(self, other): return -1 return cmp((self._lhs, self._rhs), (other._lhs, other._rhs))