This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: slice objects comparable, not hashable
Type: Stage:
Components: Interpreter Core Versions:
process
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 2022-04-10 16:03 by admin. This issue is now closed.

Files
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 
user_id=6380

Fix applied.  Thanks!

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

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

History
Date User Action Args
2022-04-10 16:03:51adminsetgithub: 34146
2001-03-13 21:04:00robin900create