]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove dependency on itertools -- a simple genexp suffices.
authorRaymond Hettinger <python@rcn.com>
Mon, 3 Mar 2008 22:04:55 +0000 (22:04 +0000)
committerRaymond Hettinger <python@rcn.com>
Mon, 3 Mar 2008 22:04:55 +0000 (22:04 +0000)
Lib/_abcoll.py

index b8f6fb94c87acee0836f63ddca345558e42d5746..7a01e1dc246f66ae53e6ce78a28198f1084aa8d5 100644 (file)
@@ -9,7 +9,6 @@ bootstrapping issues.  Unit tests are in test_collections.
 """
 
 from abc import ABCMeta, abstractmethod
-import itertools
 
 __all__ = ["Hashable", "Iterable", "Iterator",
            "Sized", "Container", "Callable",
@@ -189,7 +188,8 @@ class Set(Sized, Iterable, Container):
     def __or__(self, other):
         if not isinstance(other, Iterable):
             return NotImplemented
-        return self._from_iterable(itertools.chain(self, other))
+        chain = (e for s in (self, other) for e in s)
+        return self._from_iterable(chain)
 
     def __sub__(self, other):
         if not isinstance(other, Set):