mirror of https://github.com/flaggo/pydu.git
fix next error with python3
This commit is contained in:
parent
41f5b343cc
commit
e3f9dda932
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue