[Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.22, 1.23

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Sun Oct 26 09:25:58 EST 2003


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

Modified Files:
	test_itertools.py 
Log Message:
Minor improvements to itertools.tee():

* tee object is no longer subclassable
* independent iterators renamed to "itertools.tee_iterator"
* fixed doc string typo and added entry in the module doc string



Index: test_itertools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** test_itertools.py	24 Oct 2003 08:45:23 -0000	1.22
--- test_itertools.py	26 Oct 2003 14:25:56 -0000	1.23
***************
*** 244,247 ****
--- 244,259 ----
          self.assertRaises(TypeError, tee, [1,2], 'x')
  
+         try:
+             class A(tee): pass
+         except TypeError:
+             pass
+         else:
+             self.fail("tee constructor should not be subclassable")
+ 
+         # tee_iterator should not be instantiable
+         a, b = tee(xrange(10))
+         self.assertRaises(TypeError, type(a))
+         self.assert_(a is iter(a))  # tee_iterator should support __iter__
+ 
      def test_StopIteration(self):
          self.assertRaises(StopIteration, izip().next)





More information about the Python-checkins mailing list