Sorting list by an attribute that can be None,my_list.sort(key=nonesorter)