[issue38001] Unexpected behaviour of 'is' operator

Karthikeyan Singaravelan report at bugs.python.org
Sun Sep 1 10:31:49 EDT 2019


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

This will emit a SyntaxWarning in Python 3.8 to use == instead of using is for literals. This is not a bug but an implementation detail over caching a range of integers at https://github.com/python/cpython/blob/1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70/Objects/longobject.c#L19

----------
nosy: +xtreak

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38001>
_______________________________________


More information about the Python-bugs-list mailing list