[New-bugs-announce] [issue40565] is comparison returns False while ids are the same.
halil ibrahim yıldırım
report at bugs.python.org
Fri May 8 12:06:59 EDT 2020
New submission from halil ibrahim yıldırım <hyildirim at socialthinks.com>:
While id(a[:]) and id(a[0:3]) are the same however is comparison returns False. I thought it could be a bug.
>>> a = [1, 2, 3]
>>> id(a[:]) == id(a[0:3])
True
>>> a[:] is a[0:3]
False
----------
files: 2020-05-07_16-47-56-afa654f51735fad98b3a593a2ea539fd.png
messages: 368450
nosy: ihalil95
priority: normal
pull_requests: 19316
severity: normal
status: open
title: is comparison returns False while ids are the same.
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49143/2020-05-07_16-47-56-afa654f51735fad98b3a593a2ea539fd.png
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40565>
_______________________________________
More information about the New-bugs-announce
mailing list