Sort in py, fixed sort in c++