diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-05-23 04:34:12 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-05-23 04:34:12 (GMT) |
commit | e17de091012eb928c5734856eeaf2bb8f99e40c1 (patch) | |
tree | 5c1e694b6e9913434b5e59a4744a4886e8af7cfa | |
parent | 7096e26983c5c8ce3e5f7dae42959e7ffe91bd5e (diff) | |
download | cpython-e17de091012eb928c5734856eeaf2bb8f99e40c1.zip cpython-e17de091012eb928c5734856eeaf2bb8f99e40c1.tar.gz cpython-e17de091012eb928c5734856eeaf2bb8f99e40c1.tar.bz2 |
Issue #21545: Add .pop example and tweak comment about pure mutation methods.
Patch prepared by David Harrigan.
-rw-r--r-- | Doc/tutorial/datastructures.rst | 9 | ||||
-rw-r--r-- | Misc/ACKS | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index 24d2d2e..f2b66f7 100644 --- a/Doc/tutorial/datastructures.rst +++ b/Doc/tutorial/datastructures.rst @@ -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: @@ -507,6 +507,7 @@ Barry Hantman Lynda Hardman Derek Harland Jason Harper +David Harrigan Brian Harring Jonathan Hartley Travis B. Hartwell |