classification
Title: The cgi docs should advertize using "in" instead of "has_key"
Type: Stage: resolved
Components: Documentation Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: cito, ezio.melotti, georg.brandl, r.david.murray
Priority: low Keywords: patch

Created on 2009-07-05 16:05 by cito, last changed 2009-07-22 21:21 by ezio.melotti. This issue is now closed.

Files
File name Uploaded Description Edit
cgi.patch cito, 2009-07-05 16:05
issue6423.patch ezio.melotti, 2009-07-22 02:52 cgi.patch with few changes
Messages (6)
msg90158 - (view) Author: Christoph Zwerschke (cito) * Date: 2009-07-05 16:05
The cgi.Fieldstorage class supports the __contains__ method since Py
2.2, but the documentation of Py 2.6 still only mentions the old
fashioned has_key method. See patch.
msg90167 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-07-06 08:44
Patch looks good and is ready to commit.  Py3k seems to have been fixed
already.
msg90794 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2009-07-22 02:52
I rephrased the doc and removed has_key at all, fixed the rst markup for
'in' and improved a little the example.
If the attached patch is ok I'll commit it.

The py3 doc is slightly different, they should probably be the same (I
prefer 'in' over '__contains__' and my version of the example, the text
is pretty much the same in both).

Georg?
msg90798 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-07-22 03:28
Your patch looks good.  I was going to opine that mentioning
__contains__ was good because it would lead the reader to understand how
'in' is supported, but since the len function is referenced but that
doesn't let you learn about __len__, you might as well be consistent and
talk about in and not __contains__.  So I'd vote for changing the 3.x
docs to match.

I agree with you about the example.
msg90805 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-07-22 08:41
Metoo :) Go ahead.
msg90822 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2009-07-22 21:21
Fixed in r74179 (trunk) and r74180 (py3k).
Thanks!
History
Date User Action Args
2009-07-22 21:21:25ezio.melottisetstatus: open -> closed
messages: + msg90822

keywords: - needs review
resolution: accepted -> fixed
stage: patch review -> resolved
2009-07-22 08:41:37georg.brandlsetmessages: + msg90805
2009-07-22 03:28:00r.david.murraysetnosy: + r.david.murray
messages: + msg90798
2009-07-22 02:52:43ezio.melottisetkeywords: + needs review
files: + issue6423.patch
messages: + msg90794

stage: patch review
2009-07-10 00:09:38ezio.melottisetpriority: low
2009-07-06 08:44:57georg.brandlsetnosy: + ezio.melotti
messages: + msg90167

assignee: georg.brandl -> ezio.melotti
resolution: accepted
2009-07-05 16:05:30citocreate