Commit Function In Python Boolean Variable