Batuhan Taskaya <isidenti...@gmail.com> added the comment:

> 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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42454>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to