diff options
author | Raymond Hettinger <python@rcn.com> | 2003-10-26 14:25:56 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-10-26 14:25:56 (GMT) |
commit | f0c5aec85f30ed16d1a8b4d3113bd056881bbf6f (patch) | |
tree | 0bfda0ad7b4f1835382bca871e0e7ccc77327a54 /Lib/test/test_itertools.py | |
parent | 397b45d4bacc057884c8ba18f83ef15d9bfb6149 (diff) | |
download | cpython-f0c5aec85f30ed16d1a8b4d3113bd056881bbf6f.zip cpython-f0c5aec85f30ed16d1a8b4d3113bd056881bbf6f.tar.gz cpython-f0c5aec85f30ed16d1a8b4d3113bd056881bbf6f.tar.bz2 |
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
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r-- | Lib/test/test_itertools.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index ce03b1a..e12aa41 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -243,6 +243,18 @@ class TestBasicOps(unittest.TestCase): self.assertRaises(TypeError, tee, 3) 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) |