X-Git-Url: https://git.korewanetadesu.com/?p=python-collate.git;a=blobdiff_plain;f=collate%2Ficu%2F__init__.py;fp=collate%2Ficu%2F__init__.py;h=e7dfe2d9c1d47cfe65bbd442fef67da1ca522c21;hp=5f3ec05f98f19d051c4c8a6beda8b14fc0968081;hb=7644110ce07ec8a78003ee7db9dcdfe5cbca3854;hpb=92fc0878bc7b75741a3434d17310e390a9304e70 diff --git a/collate/icu/__init__.py b/collate/icu/__init__.py index 5f3ec05..e7dfe2d 100644 --- a/collate/icu/__init__.py +++ b/collate/icu/__init__.py @@ -11,6 +11,8 @@ Avoid this backend if... """ +__all__ = ["Collator"] + import collate._abcollator import collate._locale import collate.errors @@ -21,6 +23,7 @@ class Collator(collate._abcollator.Collator): """ICU-based collation.""" def __init__(self, locale, encoding=None): + super(Collator, self).__init__(locale, encoding) locale, encoding = collate._locale.getpair(locale, encoding) icu_locale = "root" if locale == "C" else locale self._collator = _icu.Collator(icu_locale) @@ -54,14 +57,3 @@ class Collator(collate._abcollator.Collator): string = string.decode(self.encoding, 'replace') return self._collator.key(string) - 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)