This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2014年05月20日 21:37 by terry.reedy, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| datastructures.patch | David.Harrigan, 2014年05月22日 14:36 | review | ||
| Messages (6) | |||
|---|---|---|---|
| msg218857 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2014年05月20日 21:37 | |
The Tutorial section More on Lists https://docs.python.org/3.4/tutorial/datastructures.html#more-on-lists includes list.pop but ignores it in the example and final comment. I think the examples should be augmented and the comment modified. 1. (simplest) End the example block with >>> a.pop() 1234.5 >>> a [-1, 1, 66.25, 333, 333] 2. The comment says "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." [The footnote says "[1] Other languages may return the mutated object, which allows method chaining, such as d->insert("a")->remove("b")->sort();."] Inserting 'only' before 'modify' makes the statement true even now with .pop added. I think 'the default' should be added before 'None', but that would be optional. I do not think .pop needs to be explicitly mentioned here since the point of the comment is to explain the lack of a printed return value, and .pop does have a printed return value. |
|||
| msg218897 - (view) | Author: David Harrigan (David.Harrigan) * | Date: 2014年05月22日 14:36 | |
I've added the example and modified the final comment. |
|||
| msg218927 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2014年05月22日 22:42 | |
That looks good and is ready to apply. |
|||
| msg218946 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2014年05月23日 04:35 | |
New changeset 6fc09f30b514 by Terry Jan Reedy in branch '2.7': Issue #21545: Add .pop example and tweak comment about pure mutation methods. http://hg.python.org/cpython/rev/6fc09f30b514 New changeset 3f2b6034b73a by Terry Jan Reedy in branch '3.4': Issue #21545: Add .pop example and tweak comment about pure mutation methods. http://hg.python.org/cpython/rev/3f2b6034b73a |
|||
| msg218947 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2014年05月23日 04:38 | |
Thanks David. If this is not to be your last contribution, and we hope not, please fill out the contributor agreement, if you have hot already, at https://www.python.org/psf/contrib/contrib-form/ |
|||
| msg218967 - (view) | Author: David Harrigan (David.Harrigan) * | Date: 2014年05月23日 12:37 | |
Thanks for the info, I've signed the agreement. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:03 | admin | set | github: 65744 |
| 2014年05月23日 12:37:02 | David.Harrigan | set | messages: + msg218967 |
| 2014年05月23日 04:38:02 | terry.reedy | set | status: open -> closed resolution: fixed messages: + msg218947 stage: needs patch -> resolved |
| 2014年05月23日 04:35:16 | python-dev | set | nosy:
+ python-dev messages: + msg218946 |
| 2014年05月22日 22:42:01 | rhettinger | set | nosy:
+ rhettinger messages: + msg218927 |
| 2014年05月22日 14:36:01 | David.Harrigan | set | files:
+ datastructures.patch nosy: + David.Harrigan messages: + msg218897 keywords: + patch |
| 2014年05月20日 22:56:53 | cvrebert | set | nosy:
+ cvrebert |
| 2014年05月20日 21:37:33 | terry.reedy | create | |