Minor doc fixups.
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index 78b10c7..240baf0 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -282,7 +282,7 @@
class groupby(object):
# [k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B
- # [(list(g)) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D
+ # [list(g) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D
def __init__(self, iterable, key=None):
if key is None:
key = lambda x: x
@@ -675,8 +675,8 @@
return imap(function, count(start))
def nth(iterable, n):
- "Returns the nth item or empty list"
- return list(islice(iterable, n, n+1))
+ "Returns the nth item or None"
+ return next(islice(iterable, n, None), None)
def quantify(iterable, pred=bool):
"Count how many times the predicate is true"