Marko Rauhamaa <ma...@pacujo.net> writes:

> Ben Finney <ben+pyt...@benfinney.id.au>:
>
> > They are *not* necessarily distinct from other strings with equal
> > value, defined elsewhere. That's what has been pointed out to you
> > many times.
>
> That point is completely irrelevant. The state objects only need to be
> distinct from each other.

In which case, don't mislead the reader by comparing with ‘is’.

Since you don't care about identity, only that the objects have
different values, you should be comparing for equality with ‘==’.

> How do I know? I originally wrote the example.

Yes. And as the author, you're being misleading by using the identity
comparison, when you don't care about their identity by your own
admission here.

-- 
 \          Eccles: “I'll get [the job] too, you'll see. I'm wearing a |
  `\        Cambridge tie.”  Greenslade: “What were you doing there?”  |
_o__)   Eccles: “Buying a tie.” —The Goon Show, _The Greenslade Story_ |
Ben Finney

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

Reply via email to