*** Objects/sliceobject.old Tue Mar 13 17:41:45 2001 --- Objects/sliceobject.c Tue Mar 13 20:56:52 2001 *************** *** 155,160 **** --- 155,183 ---- return ret; } + static int + slice_compare (PySliceObject *v, PySliceObject *w) + { + int result = 0; + if (v == w) { + return result; + } + /* compare start, stop, step in series until result != 0 */ + /* exception will be set by PyObject_Cmp if problem, + return value is unimportant */ + if ( PyObject_Cmp(v->start, w->start, &result) == -1 ) { + return 0; + } + else if ( result != 0 ) { return result; } + if ( PyObject_Cmp(v->stop, w->stop, &result) == -1 ) { + return 0; + } + else if ( result != 0 ) { return result; } + if ( PyObject_Cmp(v->step, w->step, &result) == -1 ) { + return 0; + } + return result; + } PyTypeObject PySlice_Type = { PyObject_HEAD_INIT(&PyType_Type) *************** *** 166,174 **** 0, /*tp_print*/ (getattrfunc)slice_getattr, /*tp_getattr*/ 0, /*tp_setattr*/ ! 0, /*tp_compare*/ ! (reprfunc)slice_repr, /*tp_repr*/ 0, /*tp_as_number*/ ! 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ }; --- 189,197 ---- 0, /*tp_print*/ (getattrfunc)slice_getattr, /*tp_getattr*/ 0, /*tp_setattr*/ ! (cmpfunc)slice_compare, /*tp_compare*/ ! (reprfunc)slice_repr, /*tp_repr*/ 0, /*tp_as_number*/ ! 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ };