Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
928713c7
Commit
928713c7
authored
Jul 13, 2007
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct the docs for takewhile(). Improve the recipe for nth(). Should be backported
parent
5a3b524e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Doc/lib/libitertools.tex
Doc/lib/libitertools.tex
+3
-3
No files found.
Doc/lib/libitertools.tex
View file @
928713c7
...
@@ -117,7 +117,7 @@ by functions or loops that truncate the stream.
...
@@ -117,7 +117,7 @@ by functions or loops that truncate the stream.
Make an iterator that drops elements from the iterable as long as
Make an iterator that drops elements from the iterable as long as
the predicate is true; afterwards, returns every element. Note,
the predicate is true; afterwards, returns every element. Note,
the iterator does not produce
\emph
{
any
}
output until the predicate
the iterator does not produce
\emph
{
any
}
output until the predicate
is tru
e, so it may have a lengthy start-up time. Equivalent to:
first becomes fals
e, so it may have a lengthy start-up time. Equivalent to:
\begin{verbatim}
\begin{verbatim}
def dropwhile(predicate, iterable):
def dropwhile(predicate, iterable):
...
@@ -509,8 +509,8 @@ def iteritems(mapping):
...
@@ -509,8 +509,8 @@ def iteritems(mapping):
return izip
(
mapping.iterkeys
()
, mapping.itervalues
())
return izip
(
mapping.iterkeys
()
, mapping.itervalues
())
def nth
(
iterable, n
)
:
def nth
(
iterable, n
)
:
"Returns the nth item or raise
IndexError
"
"Returns the nth item or raise
StopIteration
"
return
list
(
islice
(
iterable, n, n
+
1
))[
0
]
return
islice
(
iterable, n, None
)
.next
()
def all
(
seq, pred
=
None
)
:
def all
(
seq, pred
=
None
)
:
"Returns True if pred
(
x
)
is true for every element in the iterable"
"Returns True if pred
(
x
)
is true for every element in the iterable"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment