[ python-Bugs-1733184 ] slice type is unhashable
SourceForge.net
noreply at sourceforge.net
Fri Jun 8 04:30:16 CEST 2007
Bugs item #1733184, was opened at 2007-06-07 19:30
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1733184&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: L. Peter Deutsch (lpd)
Assigned to: Nobody/Anonymous (nobody)
Summary: slice type is unhashable
Initial Comment:
Patch # 408326 is a "bug fix" that makes slice objects comparable but explicitly NOT hashable. I don't understand why Guido thinks this is the right behavior for them: they are immutable, have well-defined state, do not include references to mutable objects, and can be compared property for equality. Why shouldn't they be usable as dictionary keys? I have an application that really would like them to be usable as such. I know I can define a class Slice of my own .. but that seems so silly.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1733184&group_id=5470
More information about the Python-bugs-list
mailing list