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
cc798377
Commit
cc798377
authored
May 23, 2014
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #21545: Add .pop example and tweak comment about pure mutation methods.
Patch prepared by David Harrigan.
parent
fd613498
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
Doc/tutorial/datastructures.rst
Doc/tutorial/datastructures.rst
+9
-0
Misc/ACKS
Misc/ACKS
+1
-0
No files found.
Doc/tutorial/datastructures.rst
View file @
cc798377
...
@@ -99,6 +99,15 @@ An example that uses most of the list methods::
...
@@ -99,6 +99,15 @@ An example that uses most of the list methods::
>>> a.sort()
>>> a.sort()
>>> a
>>> a
[-1, 1, 66.25, 333, 333, 1234.5]
[-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
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:
.. _tut-lists-as-stacks:
...
...
Misc/ACKS
View file @
cc798377
...
@@ -506,6 +506,7 @@ Barry Hantman
...
@@ -506,6 +506,7 @@ Barry Hantman
Lynda Hardman
Lynda Hardman
Derek Harland
Derek Harland
Jason Harper
Jason Harper
David Harrigan
Brian Harring
Brian Harring
Jonathan Hartley
Jonathan Hartley
Travis B. Hartwell
Travis B. Hartwell
...
...
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