Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #52341 > unrolled thread
| Started by | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| First post | 2013-08-10 21:25 -0400 |
| Last post | 2013-08-10 21:25 -0400 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Python Basic Doubt Terry Reedy <tjreedy@udel.edu> - 2013-08-10 21:25 -0400
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2013-08-10 21:25 -0400 |
| Subject | Re: Python Basic Doubt |
| Message-ID | <mailman.449.1376184354.1251.python-list@python.org> |
On 8/10/2013 8:42 PM, Gary Herron wrote:
> But for each of your examples, using "==" is equivalent to using "is".
> Each of
> if something == None
> if device == _not passed
> if device != None
> would all work as expected. In none of those cases is "is" actually
> needed.
class EqualAll:
def __eq__(self, other): return True
ea = EqualAll()
print(ea == None)
print(ea == float('nan'))
>>>
True
True
--
Terry Jan Reedy
Back to top | Article view | comp.lang.python
csiph-web