Josh Rosenberg <[email protected]> added the comment:
There is an open issue for this already, under #11107 (a reopen of the closed
#2268, where the reopen was justified due to Python 3 making slice objects more
common), just so you know.
I made a stab at this a while ago and gave up due to the problems with making
slices constants while trying to keep them unhashable (and I never got to
handling the marshal format updates properly). It doesn't seem right to
incidentally make:
something[::-1] = something
actually work, and be completely nonsensical, when "something" happens to be a
dict, when previously, you'd get a clear TypeError for trying to do it. I could
definitely see code using duck-typing via slices to distinguish sequences from
other iterables and mappings, and making mapping suddenly support slices in a
nonsensical way is... odd.
----------
nosy: +josh.r
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42454>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com