9 Aug
2012
9 Aug
'12
5:48 a.m.
On 08.08.2012 23:56, Ned Batchelder wrote:
For None, "==" and "is" are equivalent, because no other object is equal to None. For True and False, this is different, and using "is" here is a very stealthy bug. It's easy to make other objects == None, by writing buggy __eq__ methods. That doesn't happen much, but it's easier with __ne__, where
On 8/8/2012 4:29 PM, Georg Brandl wrote: the negated logic is easy to screw up. I've seen it happen. Use "is None", not "== None".
That's true indeed. Georg