[Python-checkins] python/dist/src/Lib/test test_slice.py,1.5,1.6

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Fri Sep 5 08:27:32 EDT 2003


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv12639/Lib/test

Modified Files:
	test_slice.py 
Log Message:
SF bug #800796:  Difference between hash() and __hash__()

slice(5).__hash__() now raises a TypeError.



Index: test_slice.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_slice.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** test_slice.py	2 Sep 2003 01:53:01 -0000	1.5
--- test_slice.py	5 Sep 2003 14:27:30 -0000	1.6
***************
*** 15,18 ****
--- 15,23 ----
          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)





More information about the Python-checkins mailing list