SF bug #800796:  Difference between hash() and __hash__()

slice(5).__hash__() now raises a TypeError.
diff --git a/Lib/test/test_slice.py b/Lib/test/test_slice.py
index d216c30..d8eb882 100644
--- a/Lib/test/test_slice.py
+++ b/Lib/test/test_slice.py
@@ -14,6 +14,11 @@
     def test_repr(self):
         self.assertEqual(repr(slice(1, 2, 3)), "slice(1, 2, 3)")
 
+    def test_hash(self):
+        # Verify clearing of SF bug #800796
+        self.assertRaises(TypeError, hash, slice(5))
+        self.assertRaises(TypeError, slice(5).__hash__)
+
     def test_cmp(self):
         s1 = slice(1, 2, 3)
         s2 = slice(1, 2, 3)
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index 796df2b..c37af2b 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -278,6 +278,13 @@
 	return result;
 }
 
+static long
+slice_hash(PySliceObject *v)
+{
+	PyErr_SetString(PyExc_TypeError, "unhashable type");
+	return -1L;
+}
+
 PyTypeObject PySlice_Type = {
 	PyObject_HEAD_INIT(&PyType_Type)
 	0,			/* Number of items for varobject */
@@ -293,7 +300,7 @@
 	0,					/* tp_as_number */
 	0,	    				/* tp_as_sequence */
 	0,					/* tp_as_mapping */
-	0,					/* tp_hash */
+	(hashfunc)slice_hash,			/* tp_hash */
 	0,					/* tp_call */
 	0,					/* tp_str */
 	PyObject_GenericGetAttr,		/* tp_getattro */