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
6e35394e
Commit
6e35394e
authored
Dec 04, 2010
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mention itertools.accumulate().
parent
6f04adc5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
Doc/library/random.rst
Doc/library/random.rst
+1
-0
Doc/whatsnew/3.2.rst
Doc/whatsnew/3.2.rst
+18
-1
No files found.
Doc/library/random.rst
View file @
6e35394e
...
...
@@ -274,6 +274,7 @@ change across Python versions, but two aspects are guaranteed not to change:
* The generator's :meth:`random` method will continue to produce the same
sequence when the compatible seeder is given the same seed.
.. _random-examples:
Examples and Recipes
====================
...
...
Doc/whatsnew/3.2.rst
View file @
6e35394e
...
...
@@ -405,7 +405,8 @@ New, Improved, and Deprecated Modules
>>> get_phone_number.cache_clear()
(Contributed by Raymond Hettinger.)
(Contributed by Raymond Hettinger and incorporating design ideas from
Jim Baker, Miki Tebeka, and Nick Coglan.)
* The :func:`functools.wraps` decorator now adds a :attr:`__wrapped__` attribute
pointing to the original callable function. This allows wrapped functions to
...
...
@@ -416,6 +417,22 @@ New, Improved, and Deprecated Modules
(By Nick Coghlan and Terrence Cole; :issue:`9567`, :issue:`3445`, and
:issue:`8814`.)
* The :mod:`itertools` module has a new function, :func:`~itertools.accumulate`
modeled on APL's *scan* and on Numpy's *accumulate* function:
>>> list(accumulate(8, 2, 50))
[8, 10, 60]
>>> prob_dist = [0.1, 0.4, 0.2, 0.3]
>>> list(accumulate(prob_dist)) # cumulative probability distribution
[0.1, 0.5, 0.7, 1.0]
For an example using :func:`~itertools.accumulate`, see the :ref:`examples for
the random module <random-examples>`.
(Contributed by Raymond Hettinger and incorporating design suggestions
from Mark Dickinson.)
* The :mod:`nntplib` module gets a revamped implementation with better
bytes / unicode semantics as well as more practical APIs. These improvements
break compatibility with the nntplib version in Python 3.1, which was
...
...
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