Re: What's wrong with `is not None`?

2005-02-09 Thread [EMAIL PROTECTED]
btw, 'isnot' is not pronounced "is-not" but rather "i-snot". :-) S -- http://mail.python.org/mailman/listinfo/python-list

Re: What's wrong with `is not None`?

2005-02-09 Thread François Pinard
[Stefan Behnel] > Frans Englich schrieb: > >What is the equivalent expression which is more secure; `!= None`? > If I want to check for None, I always do it with "is". It's a constant > after all... So do I. There is only one None object, for which an `is' test is especially appropriate. -- F

Re: What's wrong with `is not None`?

2005-02-09 Thread Stefan Behnel
Frans Englich schrieb: What is the equivalent expression which is more secure; `!= None`? Note that this is not necessarily equivalent. '!=' and '==' possibly run method calls on objects which can be costly depending on their implementation and can even raise exceptions if called with None. If I wa

Re: What's wrong with `is not None`?

2005-02-08 Thread Jive Dadson
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

Re: What's wrong with `is not None`?

2005-02-08 Thread Leif K-Brooks
Frans Englich wrote: runner.py:587: Using is not None, may not always work It's a PyChecker bug relating to None being a constant in 2.4: . -- http://mail.python.org/mailman/listinfo/python-list

What's wrong with `is not None`?

2005-02-08 Thread Frans Englich
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`? Chee