Cleanup in preparation for release. Add docstrings, remove basically empty _constants...
[python-collate.git] / collate / codepoint.py
index e0bbcbd..9987933 100644 (file)
@@ -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