X-Git-Url: https://git.korewanetadesu.com/?p=python-collate.git;a=blobdiff_plain;f=collate%2Fcodepoint.py;h=9987933e08ff3c61dfd784da49a00dfec90aa21b;hp=e0bbcbd2f873dbc3cc05b3e3ce45080f3adafe5c;hb=7644110ce07ec8a78003ee7db9dcdfe5cbca3854;hpb=92fc0878bc7b75741a3434d17310e390a9304e70 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