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

noreply@sourceforge.net noreply@sourceforge.net
Tue, 20 Mar 2001 04:42:43 -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: Closed
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.



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

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-03-20 04:42

Message:
Logged In: YES 
user_id=6380

Fix applied.  Thanks!

(Isn't there a corresponding bug report that should be
closed?)

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

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