Author BTaskaya
Recipients BTaskaya, Mark.Shannon, christian.heimes, josh.r, mark.dickinson, pablogsal, rhettinger, serhiy.storchaka
Date 2020-11-25.08:47:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1606294060.3.0.235009443702.issue42454@roundup.psfhosted.org>
In-reply-to
Content
> something[::-1] = something

I was thinking this for a while, and this is the actual reason that I didn't propose this until I saw someone's comment under Raymond's tweet about 'slices are not hashable' (https://twitter.com/4skvictor/status/1330433911646785539). At least for optimization, IMHO it worth taking the shot. 

> I could definitely see code using duck-typing via slices to distinguish sequences from other iterables and mappings

That sounds a bit unorthodox. It is a very common practice to use ABCs for doing these checks but I've never seen a piece of code where they test if something is a mapping or not by throwing unhashable things in it.
History
Date User Action Args
2020-11-25 08:47:40BTaskayasetrecipients: + BTaskaya, rhettinger, mark.dickinson, christian.heimes, Mark.Shannon, serhiy.storchaka, josh.r, pablogsal
2020-11-25 08:47:40BTaskayasetmessageid: <1606294060.3.0.235009443702.issue42454@roundup.psfhosted.org>
2020-11-25 08:47:40BTaskayalinkissue42454 messages
2020-11-25 08:47:40BTaskayacreate