Space Complexity Of Sort Function In Python