http://hg.python.org/cpython/rev/1026b1d47f30
changeset: 83037:1026b1d47f30
branch: 2.7
parent: 83034:e044d22d2f61
user: Raymond Hettinger <python(a)rcn.com>
date: Sat Mar 30 23:37:57 2013 -0700
summary:
Add an itertools recipe showing how to use t.__copy__().
files:
Doc/library/itertools.rst | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -828,6 +828,18 @@
indices = sorted(random.randrange(n) for i in xrange(r))
return tuple(pool[i] for i in indices)
+ def tee_lookahead(t, i):
+ """Inspect the i-th upcomping value from a tee object
+ while leaving the tee object at its current position.
+
+ Raise an IndexError if the underlying iterator doesn't
+ have enough values.
+
+ """
+ for value in islice(t.__copy__(), i, None):
+ return value
+ raise IndexError(i)
+
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::
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/61092bbd1464
changeset: 83045:61092bbd1464
branch: 3.3
parent: 83041:96776fc3cbcc
user: Roger Serwy <roger.serwy(a)gmail.com>
date: Sun Mar 31 15:53:08 2013 -0500
summary:
#8900: Using keyboard shortcuts in IDLE to open a file no longer raises an exception.
files:
Lib/idlelib/MultiCall.py | 5 +++--
Misc/NEWS | 3 +++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Lib/idlelib/MultiCall.py b/Lib/idlelib/MultiCall.py
--- a/Lib/idlelib/MultiCall.py
+++ b/Lib/idlelib/MultiCall.py
@@ -170,8 +170,9 @@
break
ishandlerrunning[:] = []
# Call all functions in doafterhandler and remove them from list
- while doafterhandler:
- doafterhandler.pop()()
+ for f in doafterhandler:
+ f()
+ doafterhandler[:] = []
if r:
return r
return handler
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -15,6 +15,9 @@
Library
-------
+- Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer
+ raises an exception.
+
- Issue #6649: Fixed missing exit status in IDLE. Patch by Guilherme Polo.
- Issue #17435: threading.Timer's __init__ method no longer uses mutable
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/37352a3ccd54
changeset: 83044:37352a3ccd54
branch: 2.7
parent: 83040:cfd4cd15809e
user: Roger Serwy <roger.serwy(a)gmail.com>
date: Sun Mar 31 15:53:08 2013 -0500
summary:
#8900: Using keyboard shortcuts in IDLE to open a file no longer raises an exception.
files:
Lib/idlelib/MultiCall.py | 5 +++--
Misc/NEWS | 3 +++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Lib/idlelib/MultiCall.py b/Lib/idlelib/MultiCall.py
--- a/Lib/idlelib/MultiCall.py
+++ b/Lib/idlelib/MultiCall.py
@@ -171,8 +171,9 @@
break
ishandlerrunning[:] = []
# Call all functions in doafterhandler and remove them from list
- while doafterhandler:
- doafterhandler.pop()()
+ for f in doafterhandler:
+ f()
+ doafterhandler[:] = []
if r:
return r
return handler
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@
Library
-------
+- Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer
+ raises an exception.
+
- Issue #6649: Fixed missing exit status in IDLE. Patch by Guilherme Polo.
- Issue #17526: fix an IndexError raised while passing code without filename to
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/devguide/rev/3b30c415c9a5
changeset: 616:3b30c415c9a5
user: Georg Brandl <georg(a)python.org>
date: Sun Mar 31 19:46:14 2013 +0200
summary:
Clarify policy for security branches. List RMs for active branches.
files:
devcycle.rst | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/devcycle.rst b/devcycle.rst
--- a/devcycle.rst
+++ b/devcycle.rst
@@ -93,10 +93,13 @@
The only changes made to a security branch are those fixing issues exploitable
by attackers such as crashes, privilege escalation and, optionally, other
-issues such as denial of service attacks. Other behavioral issues are
+issues such as denial of service attacks. Any other changes are
**not** considered a security risk and thus not backported to a security branch.
-Any release made from a security branch is source-only and done only when
-actual security patches have been applied to the branch.
+
+Commits to security branches are to be coordinated with the release manager
+for the corresponding feature version, as listed below in the Summary_.
+Any release made from a security branch is source-only and done only when actual
+security patches have been applied to the branch.
.. _listbranch:
@@ -104,16 +107,20 @@
Summary
-------
-There are 6 open branches right now in the Mercurial repository:
+There are 6 active branches right now in the Mercurial repository:
- the ``default`` branch holds the future 3.4 version and descends from ``3.3``
+ (future RM: Larry Hastings)
- the ``3.3`` branch holds bug fixes for future 3.3.x maintenance releases
- and descends from ``3.2``
+ and descends from ``3.2`` (RM: Georg Brandl)
- the ``3.2`` branch holds security fixes for future 3.2.x security releases
+ (RM: Georg Brandl)
- the ``3.1`` branch holds security fixes for future 3.1.x security releases
+ (RM: Benjamin Peterson)
- the ``2.7`` branch holds bug fixes for future 2.7.x maintenance releases and
- descends from ``2.6``
+ descends from ``2.6`` (RM: Benjamin Peterson)
- the ``2.6`` branch holds security fixes for future 2.6.x security releases
+ (RM: Barry Warsaw)
.. _stages:
--
Repository URL: http://hg.python.org/devguide