python: Use 'is' for identity when comparing against None