(x, sort_key, sort_type)
return result
Sadly python 3 makes it very hard to sort mixed types
        We can work around this by forcing the types
Sadly python 3 makes it very hard to sort mixed types
        We can work around this by forcing the types
Sadly python 3 makes it very hard to sort mixed types We can work around this by forcing the types
def sort_helper(x, sort_key, sort_type):
    """ Sadly python 3 makes it very hard to sort mixed types
        We can work around this by forcing the types
    """
    result = x[sort_key]
    if result is None:
        if sort_type == DATE:
            result = datetime.date(datetime.MINYEAR, 1, 1)
        elif sort_type == NUMBER:
            result = 0
        else:  # Last try - make it a string
            result = ''
    return result
def sort_helper ( x , sort_key , sort_type ) : result = x [ sort_key ] if result is None : if sort_type == DATE : result = datetime . date ( datetime . MINYEAR , 1 , 1 ) elif sort_type == NUMBER : result = 0 else : # Last try - make it a string result = '' return result