sort() returns None
问题 Code: import math import time import random class SortClass(object): def sort1(self, l): if len(l)==1: return l elif len(l)==2: if l[0]<l[1]: return l else: return l[::-1] else: pivot=math.floor(len(l)/2) a=l[pivot:] b=l[:pivot] a2=self.sort1(a) b2=self.sort1(b) if a2==None or b2==None: a2=[] b2=[] return (a2+b2).sort() return [] Sort=SortClass() x=[20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1] print(Sort.sort1(x)) The code outputs None even though it should return an empty list in two