diff options
author | Raymond Hettinger <python@rcn.com> | 2008-03-03 22:04:55 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-03-03 22:04:55 (GMT) |
commit | 972fb077a022722113e155ebf564f98ebdbe2b65 (patch) | |
tree | e06fd952daef9483cb12beb43a72f1530b0c4562 | |
parent | 8e67ef52dbb8434cc571b9ed3b6bfa6096e077da (diff) | |
download | cpython-972fb077a022722113e155ebf564f98ebdbe2b65.zip cpython-972fb077a022722113e155ebf564f98ebdbe2b65.tar.gz cpython-972fb077a022722113e155ebf564f98ebdbe2b65.tar.bz2 |
Remove dependency on itertools -- a simple genexp suffices.
-rw-r--r-- | Lib/_abcoll.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index b8f6fb9..7a01e1d 100644 --- a/Lib/_abcoll.py +++ b/Lib/_abcoll.py @@ -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): |