8000 Update itertools docs by rhettinger · Pull Request #15114 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Update itertools docs #15114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 4, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove suggestion that is less relevant now that global lookups are m…
…uch faster
  • Loading branch information
rhettinger committed Aug 4, 2019
commit 13e4a4172122aaa3abca483cbe24b98e935e81ff
6 changes: 0 additions & 6 deletions Doc/library/itertools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -913,9 +913,3 @@ which incur interpreter overhead.
result.append(pool[-1-n])
return tuple(result)

Note, many of the above recipes can be optimized by replacing global lookups
with local variables defined as default values. For example, the
*dotproduct* recipe can be written as::

def dotproduct(vec1, vec2, sum=sum, map=map, mul=operator.mul):
return sum(map(mul, vec1, vec2))
0