[Python-checkins] cpython (3.4): Issue #21545: Add .pop example and tweak comment about pure mutation methods.
terry.reedy
python-checkins at python.org
Fri May 23 06:35:17 CEST 2014
http://hg.python.org/cpython/rev/3f2b6034b73a
changeset: 90794:3f2b6034b73a
branch: 3.4
parent: 90791:37d2a6bcf7ae
user: Terry Jan Reedy <tjreedy at udel.edu>
date: Fri May 23 00:34:12 2014 -0400
summary:
Issue #21545: Add .pop example and tweak comment about pure mutation methods.
Patch prepared by David Harrigan.
files:
Doc/tutorial/datastructures.rst | 9 +++++++--
Misc/ACKS | 1 +
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -111,10 +111,15 @@
>>> a.sort()
>>> a
[-1, 1, 66.25, 333, 333, 1234.5]
+ >>> a.pop()
+ 1234.5
+ >>> a
+ [-1, 1, 66.25, 333, 333]
You might have noticed that methods like ``insert``, ``remove`` or ``sort`` that
-modify the list have no return value printed -- they return ``None``. [1]_ This
-is a design principle for all mutable data structures in Python.
+only modify the list have no return value printed -- they return the default
+``None``. [1]_ This is a design principle for all mutable data structures in
+Python.
.. _tut-lists-as-stacks:
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -507,6 +507,7 @@
Lynda Hardman
Derek Harland
Jason Harper
+David Harrigan
Brian Harring
Jonathan Hartley
Travis B. Hartwell
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list