1 """Codepoint-based collation.
3 This collation backend sorts using only the basic codepoint order. It
4 is primarily intended to be used as a baseline and example for other
7 Use this collation backend if...
8 - You are writing tests for pycollate.
9 - You are writing specialized Unicode software.
10 - You are on a system with no locale module.
12 Avoid this backend if...
13 - You are writing a normal program for a normal runtime environment.
14 - You are sorting strings to show normal humans.
18 __all__
= ["Collator"]
20 import collate
._abcollator
21 import collate
._locale
23 class Collator(collate
._abcollator
.Collator
):
24 """Codepoint-based collation.
27 locale - all parts but encoding ignored, always 'C'
28 encoding - try to use this string encoding
31 def __init__(self
, locale
=None, encoding
=None):
32 super(Collator
, self
).__init
__(locale
, encoding
)
33 dummy
, self
.encoding
= collate
._locale
.getpair(locale
, encoding
)