Title: slice objects comparable, not hashable
Type: Stage:
Components: Interpreter Core Versions:
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: gvanrossum, robin900
Priority: normal Keywords: patch

Created on 2001-03-13 21:04 by robin900, last changed 2001-03-20 16:09 by robin900. This issue is now closed.

File name Uploaded Description Edit
slicediff robin900, 2001-03-13 21:04
Messages (3)
msg36048 - (view) Author: Robin Thomas (robin900) Date: 2001-03-13 21:04
This patch changes the behavior of slice objects in 
the following manner:

- Slice objects are now comparable with other slice 
objects as though they were logically tuples of 
(start,stop,step). The tuple is not created in the 
comparison function, but the comparison behavior is 
logically equivalent.

- Slice objects are not hashable. With the above 
change to being comparable, slice objects now cannot 
be used as keys in dictionaries.

I ask that this patch be considered a "bug fix", 
rather than a change in functionality, and thus be 
included in 2.1b2 and forward.

Other proposed changes to slicing and slice objects 
have been postponed until further discussion and the 
requisite PEP submission.

msg36049 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2001-03-20 12:42
Logged In: YES 

Fix applied.  Thanks!

(Isn't there a corresponding bug report that should be
msg36050 - (view) Author: Robin Thomas (robin900) Date: 2001-03-20 16:09
Logged In: YES 

The "bug report" was just a post to the Python list. I'm 
not aware of a SourceFroge bug issue (although there might 

Date User Action Args
2001-03-13 21:04:00robin900create