From e3f9dda9327fdfa6d70144f19a88a9a04e7bec5d Mon Sep 17 00:00:00 2001 From: Prodesire Date: Sat, 3 Feb 2018 00:41:27 +0800 Subject: [PATCH] fix next error with python3 --- pydu/iter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pydu/iter.py b/pydu/iter.py index d1ed5cf..3564fdd 100644 --- a/pydu/iter.py +++ b/pydu/iter.py @@ -1,12 +1,12 @@ """iteration tools""" -from compat import builtins +from .compat import builtins, imap def first(iterable): """ Get the first item in the iterable. """ - return iter(iterable).next() + return next(iter(iterable)) def last(iterable): @@ -40,4 +40,4 @@ def join(iterable, separator=''): """ Join each item of iterable to string. """ - return separator.join(map(str, iterable)) + return separator.join(imap(str, iterable))