Commits

Jason R. Coombs committed 0850eeb

Added test and fix for LineBuffer.__iter__. Fixes #7.

  • Participants
  • Parent commits dc399b6

Comments (0)

Files changed (1)

     >>> b.feed(b'Ol\xe9\n')
     >>> list(b.lines())
     ['Ol\xe9']
+
+    The LineBuffer should also act as an iterable.
+    >>> b.feed('iterate\nthis\n')
+    >>> for line in b:
+    ...    print(line)
+    iterate
+    this
     """
     line_sep_exp = re.compile(b'\r?\n')
 
         lines = self.line_sep_exp.split(self.buffer)
         # save the last, unfinished, possibly empty line
         self.buffer = lines.pop()
-        return lines
+        return iter(lines)
 
     def __iter__(self):
         return self.lines()