[pypy-issue] [issue835] Different behaviors of 'is' and '==' than cpython

shhong tracker at bugs.pypy.org
Thu Aug 18 23:25:57 CEST 2011


New submission from shhong <shhong at oist.jp>:

Using 'is' and '==' give different answers in list comprehension as follows 
while cPython gives the same.

>>> z = [0,1,0]
>>> u = [i for i in range(3) if z[i] is 0]
>>> u
[]
>>> u = [i for i in range(3) if z[i] == 0]
>>> u
[0, 2]

----------
messages: 2983
nosy: pypy-issue, shhong
priority: bug
status: unread
title: Different behaviors of 'is' and '==' than cpython

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue835>
________________________________________


More information about the pypy-issue mailing list