Python Sort Method Complexity