update comparison check to follow PEP8