Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue37487

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:PyList_GetItem() document: index can be 0
Type:behaviorStage:resolved
Components:DocumentationVersions:Python 3.9, Python 3.8, Python 3.7, Python 2.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: terry.reedyNosy List: docs@python, terry.reedy, 杨昆仑
Priority:normalKeywords:patch

Created on2019-07-02 14:49 by杨昆仑, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 14623mergedterry.reedy,2019-07-06 21:22
PR 14624mergedmiss-islington,2019-07-06 21:40
PR 14625mergedmiss-islington,2019-07-06 21:40
PR 14626mergedmiss-islington,2019-07-06 21:41
Messages (6)
msg347144 -(view)Author: 杨昆仑 (杨昆仑)Date: 2019-07-02 14:49
The document of this function (PyList_GetItem()) says: "Return the object at position index in the list pointed to by list. The position must be **positive**,". However test shows the correct position index should be from 0 to len(list)-1. The claim of index **must be positive** is inaccurate and confusing.
msg347373 -(view)Author: Terry J. Reedy (terry.reedy)*(Python committer)Date: 2019-07-05 20:10
Good catch. (In the future, try to include the url, as below.)The full sentence in question, athttps://docs.python.org/3/c-api/list.html#c.PyList_GetItem, is "The position must be positive, indexing from the end of the list is not supported."  'positive' should be 'non-negative'.  The next sentence deal with out-of-bounds positions, and these could be specified as '(< 0, > len(list))'
msg347444 -(view)Author: Terry J. Reedy (terry.reedy)*(Python committer)Date: 2019-07-06 21:40
New changesetf8709e804d16ec5d44b1d2f00d59a0f78df7b792 by Terry Jan Reedy in branch 'master':bpo-37487: Fix PyList_GetItem index description. (GH-14623)https://github.com/python/cpython/commit/f8709e804d16ec5d44b1d2f00d59a0f78df7b792
msg347446 -(view)Author: Terry J. Reedy (terry.reedy)*(Python committer)Date: 2019-07-06 21:54
New changesetad3720359faa933d04bde3d3222fd54e73ee7feb by Terry Jan Reedy (Miss Islington (bot)) in branch '3.8':bpo-37487: Fix PyList_GetItem index description. (GH-14623) (GH-14624)https://github.com/python/cpython/commit/ad3720359faa933d04bde3d3222fd54e73ee7feb
msg347447 -(view)Author: Terry J. Reedy (terry.reedy)*(Python committer)Date: 2019-07-06 21:55
New changeset9c930d076a7225694b369d30636a29acb556c2be by Terry Jan Reedy (Miss Islington (bot)) in branch '3.7':bpo-37487: Fix PyList_GetItem index description. (GH-14623) (GH-14625)https://github.com/python/cpython/commit/9c930d076a7225694b369d30636a29acb556c2be
msg347448 -(view)Author: Terry J. Reedy (terry.reedy)*(Python committer)Date: 2019-07-06 21:55
New changesetdd3862e167d573b6e9a3348c365229ca958d1f1f by Terry Jan Reedy (Miss Islington (bot)) in branch '2.7':bpo-37487: Fix PyList_GetItem index description. (GH-14623) (GH-14626)https://github.com/python/cpython/commit/dd3862e167d573b6e9a3348c365229ca958d1f1f
History
DateUserActionArgs
2022-04-11 14:59:17adminsetgithub: 81668
2019-07-06 21:56:26terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-07-06 21:55:44terry.reedysetmessages: +msg347448
2019-07-06 21:55:22terry.reedysetmessages: +msg347447
2019-07-06 21:54:59terry.reedysetmessages: +msg347446
2019-07-06 21:41:02miss-islingtonsetpull_requests: +pull_request14440
2019-07-06 21:40:51miss-islingtonsetpull_requests: +pull_request14439
2019-07-06 21:40:44miss-islingtonsetstage: commit review -> patch review
pull_requests: +pull_request14438
2019-07-06 21:40:30terry.reedysetmessages: +msg347444
2019-07-06 21:28:06terry.reedysetassignee:docs@python ->terry.reedy
stage: patch review -> commit review
title: PyList_GetItem() document regarding index -> PyList_GetItem() document: index can be 0
versions: + Python 2.7, Python 3.7, Python 3.8, Python 3.9, - Python 3.5
2019-07-06 21:22:35terry.reedysetkeywords: +patch
stage: patch review
pull_requests: +pull_request14437
2019-07-05 20:10:22terry.reedysetnosy: +terry.reedy
messages: +msg347373
2019-07-02 14:49:41杨昆仑create
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp