Remove dependency on itertools -- a simple genexp suffices.

This commit is contained in:
Raymond Hettinger 2008-03-03 22:04:55 +00:00
parent 8e67ef52db
commit 972fb077a0
1 changed files with 2 additions and 2 deletions

View 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):