Cleanup in preparation for release. Add docstrings, remove basically empty _constants...
[python-collate.git] / collate / _locale.py
index 70c085a..d20e184 100644 (file)
@@ -1,5 +1,7 @@
 """Locale utility routines."""
 
+__all__ = ["localelist", "encoding", "getpair"]
+
 import sys
 
 try:
@@ -12,8 +14,6 @@ try:
 except ImportError:
     codecs = None
 
-__all__ = ["localelist"]
-
 def localelist(*locales):
     """Normalize and return a list of locales, with appended defaults.
 
@@ -114,6 +114,7 @@ def encoding(preferred=None):
     return locale.getpreferredencoding() or sys.getdefaultencoding()
 
 def getpair(locale_, encoding_):
+    """If encoding_ is unspecified, get the locale encoding."""
     if "." in locale_:
         if encoding_ is None:
             locale_, encoding_ = locale_.rsplit(".", 1)