[Patches] [ python-Patches-408326 ] slice objects comparable, not hashable

noreply@sourceforge.net noreply@sourceforge.net
Mon, 19 Mar 2001 15:22:25 -0800


Patches item #408326, was updated on 2001-03-13 13:04
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=408326&group_id=5470

Category: core (C code)
Group: None
Status: Open
Priority: 5
Submitted By: Robin Thomas (robin900)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: slice objects comparable, not hashable

Initial Comment:
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.



----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=408326&group_id=5470