value of: None is None is None

D'Arcy J.M. Cain darcy at druid.net
Sat Jun 26 07:59:57 EDT 2010


On Sat, 26 Jun 2010 11:02:55 +0200
Thomas Jollans <thomas at jollans.com> wrote:
> On 06/25/2010 10:41 PM, Alan G Isaac wrote:
> >>>> None is None is None
> > True
> >>>> (None is None) is None
> > False
> >>>> None is (None is None)
> > False
> 
> Chained comparisons - one of those language features that some of the
> time makes code enormously more readable, but the rest of the time are
> rather disconcerting to those of us coming from pretty much any other
> programming language.

And yet it's seems like the "One True Way" when you think of it.  I
almost think that it should be...

>>> None is None
True
>>> None is None is None
Really True

:-)

-- 
D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



More information about the Python-list mailing list