This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Mark.Shannon
Recipients BTaskaya, Mark.Shannon, christian.heimes, josh.r, mark.dickinson, pablogsal, rhettinger, serhiy.storchaka, terry.reedy
Date 2020-11-30.17:02:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1606755763.95.0.293419565747.issue42454@roundup.psfhosted.org>
In-reply-to
Content
I agree with Mark about slice hashing.
This looks like a deliberate design decision.
x[:] = [] should empty a sequence, not set the key-value pair (slice(None, None, None), []) in a mapping.

However, code-objects can still be hashable even if slices are not.

By leaving slices unhashable, and accounting for their presence in code.__hash__, we get both the performance improvement and full backwards compatibility.
History
Date User Action Args
2020-11-30 17:02:43Mark.Shannonsetrecipients: + Mark.Shannon, rhettinger, terry.reedy, mark.dickinson, christian.heimes, serhiy.storchaka, josh.r, pablogsal, BTaskaya
2020-11-30 17:02:43Mark.Shannonsetmessageid: <1606755763.95.0.293419565747.issue42454@roundup.psfhosted.org>
2020-11-30 17:02:43Mark.Shannonlinkissue42454 messages
2020-11-30 17:02:43Mark.Shannoncreate