list comprehension problem

Ben Finney ben+python at benfinney.id.au
Fri Oct 30 05:03:31 CET 2009


(Please preserve attribution lines when you quote someone, so we can
keep track of who said what in the developing discussion.)

Nick Stinemates <nick at stinemates.org> writes:

> > Some objects are singletons, ie there's only ever one of them. The
> > most common singleton is None. In virtually every other case you
> > should be using "==" and "!=".
>
> Please correct me if I am wrong, but I believe you meant to say some
> objects are immutable, in which case you would be correct.

No, I believe the person to whom you are responding meant specifically
to talk about singletons; what they said is correct.

Objects can be equal but not identical. This is true whether or not
those objects are of an immutable type.

-- 
 \           “Prediction is very difficult, especially of the future.” |
  `\                                                       —Niels Bohr |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list