def sortByLength(instances, reverse=False):
    """Returns a new list with the instances sorted by length (method __len__)
    reverse is passed to sorted"""
    return sorted(instances, key=len, reverse=reverse)
