fix next error with python3

This commit is contained in:
Prodesire 2018-02-03 00:41:27 +08:00
parent 41f5b343cc
commit e3f9dda932
1 changed files with 3 additions and 3 deletions

View File

@ -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))