diff options
Diffstat (limited to 'natsort/locale_help.py')
-rw-r--r-- | natsort/locale_help.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/natsort/locale_help.py b/natsort/locale_help.py index 748a7cb..32bc116 100644 --- a/natsort/locale_help.py +++ b/natsort/locale_help.py @@ -7,11 +7,13 @@ and Python3 differences. from __future__ import (print_function, division, unicode_literals, absolute_import) +# Std. lib imports. import sys from itertools import chain from locale import localeconv -from .py23compat import py23_zip +# Local imports. +from natsort.py23compat import py23_zip # We need cmp_to_key for Python2 because strxfrm is broken for unicode. if sys.version[:3] == '2.7': @@ -20,7 +22,7 @@ if sys.version[:3] == '2.7': elif sys.version[:3] == '2.6': def cmp_to_key(mycmp): """Convert a cmp= function into a key= function""" - class K(object): + class K(object): # pragma: no cover __slots__ = ['obj'] def __init__(self, obj): @@ -75,12 +77,8 @@ except ImportError: from locale import strxfrm use_pyicu = False -# Convenience functions. -lowercase = lambda x: x.lower() -swapcase = lambda x: x.swapcase() - # This little lambda doubles all characters, making letters lowercase. -groupletters = lambda x: ''.join(chain(*py23_zip(lowercase(x), x))) +groupletters = lambda x: ''.join(chain(*py23_zip(x.lower(), x))) def grouper(val, func): |