]> granicus.if.org Git - python/commitdiff
Issue #21545: Add .pop example and tweak comment about pure mutation methods.
authorTerry Jan Reedy <tjreedy@udel.edu>
Fri, 23 May 2014 04:34:12 +0000 (00:34 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Fri, 23 May 2014 04:34:12 +0000 (00:34 -0400)
Patch prepared by David Harrigan.

Doc/tutorial/datastructures.rst
Misc/ACKS

index 24d2d2ec3aa3962b9fb1846655da4f7b9f47b75f..f2b66f70d830be1b118d039a535875475981c789 100644 (file)
@@ -111,10 +111,15 @@ An example that uses most of the list methods::
    >>> 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:
index a3230061ff60db03147beac497998ae879085744..97d00eabdf9e21a5a77797160c5737e623016bab 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -507,6 +507,7 @@ Barry Hantman
 Lynda Hardman
 Derek Harland
 Jason Harper
+David Harrigan
 Brian Harring
 Jonathan Hartley
 Travis B. Hartwell