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.

classification
Title: Docs imply that set does not support .pop() method
Type: behavior Stage: resolved
Components: Documentation Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, gennad, madison.may, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2013-12-24 15:33 by madison.may, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
20063.patch gennad, 2013-12-25 01:41 review
20063.patch gennad, 2013-12-25 03:26 review
Messages (8)
msg206899 - (view) Author: Madison May (madison.may) * Date: 2013-12-24 15:33
Note item 6 of http://docs.python.org/2.7/library/stdtypes.html#mutable-sequence-types is a bit misleading.  

It states: "The pop() method is only supported by the list and array types. The optional argument i defaults to -1, so that by default the last item is removed and returned."  

However, pop() is also a method of sets, which are neither lists or arrays.
msg206901 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-12-24 16:12
Well, set supporting it is irrelevant to that section, which is about mutable sequence types.  However, bytearray also supports pop, so I think perhaps that sentence should just be deleted.  The whole footnote is gone in the Python3. docs.
msg206902 - (view) Author: Madison May (madison.may) * Date: 2013-12-24 16:18
+1 for simply deleting that bit
msg206915 - (view) Author: Gennadiy Zlobin (gennad) * Date: 2013-12-25 01:41
Here's the patch
msg206916 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-12-25 02:47
Thanks, but the proposal for 2.7 is to just delete the sentence about list/array, not the whole footnote.  Unless someone can think of a mutable list type in 2.7 that does not support pop...
msg206917 - (view) Author: Gennadiy Zlobin (gennad) * Date: 2013-12-25 03:26
Got it. Looks like I was confused by absence of this footnote in Python 3 documentation) Here's updated patch.
msg206933 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-12-26 03:27
New changeset 3598805d7636 by R David Murray in branch '2.7':
#20063: Remove inaccurate/confusing statement about support of 'pop' method.
http://hg.python.org/cpython/rev/3598805d7636
msg206934 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-12-26 03:27
Thanks, Gennandiy.
History
Date User Action Args
2022-04-11 14:57:55adminsetgithub: 64262
2013-12-26 03:27:57r.david.murraysetstatus: open -> closed
type: behavior
messages: + msg206934

resolution: fixed
stage: resolved
2013-12-26 03:27:15python-devsetnosy: + python-dev
messages: + msg206933
2013-12-25 03:26:56gennadsetfiles: + 20063.patch

messages: + msg206917
2013-12-25 02:48:00r.david.murraysetmessages: + msg206916
2013-12-25 01:41:41gennadsetfiles: + 20063.patch

nosy: + gennad
messages: + msg206915

keywords: + patch
2013-12-24 16:18:43madison.maysetmessages: + msg206902
2013-12-24 16:12:04r.david.murraysetnosy: + r.david.murray
messages: + msg206901
2013-12-24 15:33:14madison.maycreate