easy question on parsing python: "is not None"

Roald de Vries downaold at gmail.com
Fri Aug 6 12:01:23 CEST 2010


On Aug 6, 2010, at 9:25 AM, Bruno Desthuilliers wrote:
> Roald de Vries a écrit :
>> 'not None' first casts None to a bool, and then applies 'not', so  
>> 'x is not None' means 'x is True'.
>
> Obviously plain wrong :
>
> Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
> [GCC 4.3.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> 42 is not None
> True
> >>> 42 is True
> False
> >>>

I know. I'm sorry. I'm embarrassed. I will check my facts better  
before posting in the future. And I'm sorry.

Cheers, Roald




More information about the Python-list mailing list