Kirk Strauser wrote:
> At 2008-12-12T15:51:15Z, Marco Mariani <ma...@sferacarta.com> writes:
> 
>> Filip GruszczyƄski wrote:
>>
>>> I am not doing it, because I need it. I can as well use "if not elem
>>> is None",
> 
>> I suggest "if elem is not None", which is not quite the same.
> 
> So what's the difference exactly?  "foo is not None" is actually surprising
> to me, since "not None" is True.  "0 is True" is False, but "0 is not None"
> is True.  Why is that?

"is not" is an operator, so the parse is

foo (is not) None

not

foo is (not None)

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to