[docs] [issue12067] Doc: remove errors about mixed-type comparisons.

Andy Maier report at bugs.python.org
Fri Jul 4 10:08:11 CEST 2014


Andy Maier added the comment:

Terry,
I'd like to comment on your statement:
> 3. By default, == and /= compare identities.
in msg148774.

What experiment lead you to that conclusion?

Here is one that contradicts it (using cpython 3.4.1):

>>> i1 = 42
>>> f1 = 42.0
>>> i1 == f1
True
>>> i1 is f1
False

Is it possible, that your experiment got influenced by the optimization that attempts to reuse existing objects of immutable types?
Like in this:

>>> i1 = 42
>>> i2 = 40 + 2
>>> i1 == i2
True
>>> i1 is i2
True

Andy

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12067>
_______________________________________


More information about the docs mailing list