This will do the right thing under cpython, but you really should use == here instead.