mirror of
https://github.com/romanz/amodem.git
synced 2026-03-21 01:49:35 +08:00
common: move izip() from recv module and refactor it a bit
This commit is contained in:
@@ -93,6 +93,13 @@ def take(iterable, n):
|
||||
return np.array(list(itertools.islice(iterable, n)))
|
||||
|
||||
|
||||
# "Python 3" zip re-implementation for Python 2
|
||||
def izip(iterables):
|
||||
iterables = [iter(iterable) for iterable in iterables]
|
||||
while True:
|
||||
yield tuple([next(iterable) for iterable in iterables])
|
||||
|
||||
|
||||
class Dummy(object):
|
||||
|
||||
def __getattr__(self, name):
|
||||
|
||||
Reference in New Issue
Block a user