update comparison in python