Jason R. Coombs avatar Jason R. Coombs committed 51d2679

Replaced chain with itertools.chain.from_iterable

Comments (0)

Files changed (1)


 # -*- coding: UTF-8 -*-
 Tools for working with iterables.  Complements itertools.
-Copyright © 2008-2011 Jason R. Coombs
+Copyright © 2008-2012 Jason R. Coombs
 from __future__ import absolute_import, unicode_literals, print_function
 	next(b, None)
 	return itertools.izip(a, b)
-def chain(sequences):
-	"""functions like itertools.chain, except chains everything in sequences.
-	Equivalent to itertools.chain(*sequences) except sequences is evaluated
-	on demand."""
-	for sequence in sequences:
-		for item in sequence:
-			yield item
+chain = itertools.chain.from_iterable
 def infiniteCall(f, *args):
 	"Perpetually yield the result of calling function f."
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.