(key)
return [convert(c) for c in re.split('([0-9]+)', key)]
Sort the given iterable in the way that humans expect.
    Thanks to http://stackoverflow.com/a/2669120/240553
Sort the given iterable in the way that humans expect.
    Thanks to http://stackoverflow.com/a/2669120/240553
Sort the given iterable in the way that humans expect . Thanks to http : // stackoverflow . com / a / 2669120 / 240553
def alphanumeric_sort_key(key):
    """
    Sort the given iterable in the way that humans expect.
    Thanks to http://stackoverflow.com/a/2669120/240553
    """
    import re
    convert = lambda text: int(text) if text.isdigit() else text
    return [convert(c) for c in re.split('([0-9]+)', key)]
def alphanumeric_sort_key ( key ) : import re convert = lambda text : int ( text ) if text . isdigit ( ) else text return [ convert ( c ) for c in re . split ( '([0-9]+)' , key ) ]