[issue1733184] slice type is unhashable

Jean-Paul Calderone report at bugs.python.org
Sat Mar 8 14:57:57 CET 2008


Jean-Paul Calderone added the comment:

I don't see the ability to use a slice as a dict key as particularly
more surprising than the ability to use ints as dict keys.  Someone who
doesn't understand how dicts work can use either of these features to
write broken programs.

I have thought about that example and it's precisely the kind of thing I
would like to work.  The behavior is consistent with that of using any
other immutable value as a key.  I don't have a use case right now (and
by admitting so may be dooming this change - but L. Peter Deutsch has
one, I think) but there's no way I would ever benefit from the current
behavior, whereas I _might_ be able to do something useful with the
proposed behavior.

_____________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1733184>
_____________________________________


More information about the Python-bugs-list mailing list