- def cmp(self, a, b):
- """Return negative if a < b, zero if a == b, positive if a > b.
-
- If strs rather than unicodes are passed in, they are first
- decoded according to the 'encoding' attribute of the Collator.
- """
- if isinstance(a, str):
- a = a.decode(self.encoding, 'replace')
- if isinstance(b, str):
- b = b.decode(self.encoding, 'replace')
- return self._collator.cmp(a, b)