Skip to content

Commit

Permalink
fix next error with python3
Browse files Browse the repository at this point in the history
  • Loading branch information
Prodesire committed Feb 2, 2018
1 parent 41f5b34 commit e3f9dda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pydu/iter.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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))

0 comments on commit e3f9dda

Please sign in to comment.