X-Git-Url: https://git.korewanetadesu.com/?p=python-collate.git;a=blobdiff_plain;f=collate%2Fcodepoint.py;h=9987933e08ff3c61dfd784da49a00dfec90aa21b;hp=e0bbcbd2f873dbc3cc05b3e3ce45080f3adafe5c;hb=HEAD;hpb=f7fd328bfc2886f6aed2c09b84cc1e039c7c3240 diff --git a/collate/codepoint.py b/collate/codepoint.py index e0bbcbd..9987933 100644 --- a/collate/codepoint.py +++ b/collate/codepoint.py @@ -15,11 +15,11 @@ Avoid this backend if... """ +__all__ = ["Collator"] + import collate._abcollator import collate._locale -__all__ = ["Collate"] - class Collator(collate._abcollator.Collator): """Codepoint-based collation. @@ -29,15 +29,6 @@ class Collator(collate._abcollator.Collator): """ def __init__(self, locale=None, encoding=None): + super(Collator, self).__init__(locale, encoding) dummy, self.encoding = collate._locale.getpair(locale, encoding) self.locale = "C" - - def key(self, string): - """Sort key for a string. - - If string is a str instance, it is first decoded according to - the 'encoding' attribute of the Collator. - """ - if isinstance(string, str): - string = string.decode(self.encoding, 'replace') - return string