Add some cross-references to the docs. Simplify the python code equivalent for zip(). Supply an optional argument for the nth() recipe.
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index 491cb18..32ad792 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -615,9 +615,9 @@
"Return function(0), function(1), ..."
return map(function, count(start))
- def nth(iterable, n):
- "Returns the nth item or None"
- return next(islice(iterable, n, None), None)
+ def nth(iterable, n, default=None):
+ "Returns the nth item or a default value"
+ return next(islice(iterable, n, None), default)
def quantify(iterable, pred=bool):
"Count how many times the predicate is true"