Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue28761

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:Add the const qualifier to fields name and doc of public structs
Type:enhancementStage:resolved
Components:Interpreter CoreVersions:Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: ncoghlan, python-dev, serhiy.storchaka
Priority:normalKeywords:patch

Created on2016-11-21 09:40 byserhiy.storchaka, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
const-name-and-doc-fields.patchserhiy.storchaka,2016-11-21 09:40review
Pull Requests
URLStatusLinkedEdit
PR 552closeddstufft,2017-03-31 16:36
Messages (4)
msg281340 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-11-21 09:40
Proposed patch makes the fields name and doc of structures PyMemberDef, PyGetSetDef, PyStructSequence_Field, PyStructSequence_Desc, and wrapperbase being of type "const char *" rather of "char *".These structures often are initialized as static variables and name and doc fields are initialized from literal strings. These fields are always refer to constant string literal, NULL, or readonly UTF8 representation of a Unicode object. They are never refer to mutable data. Changing the data referred by these pointers is an error. Adding the const qualifier makes clear that this is an immutable data.This change may need some changes in third-party code. But it needs to change only one line in CPython sources, and I believe that most third-party projects don't need any changes at all.
msg281357 -(view)Author: Alyssa Coghlan (ncoghlan)*(Python committer)Date: 2016-11-21 14:04
+1 from me. The only thing I noticed in the patch was that the issue number needs filling in now that you've filed it.
msg281434 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-11-22 05:58
New changeset42b0ba372ec2 by Serhiy Storchaka in branch 'default':Issue#28761: The fields name and doc of structures PyMemberDef, PyGetSetDef,https://hg.python.org/cpython/rev/42b0ba372ec2
msg281436 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-11-22 06:03
Thanks Nick.
History
DateUserActionArgs
2022-04-11 14:58:39adminsetgithub: 72947
2017-03-31 16:36:34dstufftsetpull_requests: +pull_request1068
2016-11-22 06:04:38serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-11-22 06:03:58serhiy.storchakasetmessages: +msg281436
2016-11-22 05:58:45python-devsetnosy: +python-dev
messages: +msg281434
2016-11-21 14:04:34ncoghlansetmessages: +msg281357
2016-11-21 09:40:15serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp