python sorted update