What's wrong with `is not None`?

Jive Dadson jdadson at yahoo.com
Tue Feb 8 20:51:23 EST 2005



Frans Englich wrote:
> 
> That's what PyChecker tells me, at least.
> 
> A line of:
> 
> if testReport is not None:
> 
> results in:
> 
> runner.py:587: Using is not None, may not always work
> 
> In what circumstances can `is not None` fail? How and why does it fail?
> 
> What is the equivalent expression which is more secure; `!= None`?

Yeah, that'll do it.

Incredibly, Microsoft has patented the "isnot" operator.  I kid you not.
They are amassing an incredible number of patents, many with no more
merit than the "isnot" one.  I'll leave it to your imagination as to
why.



More information about the Python-list mailing list