Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue28748

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:Make _Py_PackageContext of type "const char *"
Type:enhancementStage:resolved
Components:Interpreter CoreVersions:Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: brett.cannon, eric.snow, ncoghlan, python-dev, serhiy.storchaka
Priority:normalKeywords:patch

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

Files
File nameUploadedDescriptionEdit
_Py_PackageContext-const.patchserhiy.storchaka,2016-11-20 09:31review
_Py_PackageContext-const-2.patchserhiy.storchaka,2016-11-20 19:54review
Pull Requests
URLStatusLinkedEdit
PR 552closeddstufft,2017-03-31 16:36
Messages (6)
msg281256 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-11-20 09:31
Currently _Py_PackageContext has type "char *". But it is either NULL or a pointer to internal readonly UTF-8 representation of Unicode object. Adding the const qualifier makes it clear that the data is immutable. I don't think this change will break third-party code.
msg281266 -(view)Author: Alyssa Coghlan (ncoghlan)*(Python committer)Date: 2016-11-20 14:21
It technically could (if they're passing it to a function that takes a "char *"), but if they are and they can't change the affected function to take "const char *" instead, then that's an actual bug in the way they're using it.So +1 from me for explicitly declaring the immutability in 3.7+ - it will need a note in the What's New porting guide though.
msg281298 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-11-20 19:54
Added a What's New note.On GitHub I found only three projects (besides clones of CPython sources) that use _Py_PackageContext. They are not affected by this change.
msg281331 -(view)Author: Alyssa Coghlan (ncoghlan)*(Python committer)Date: 2016-11-21 08:18
Ah, my apologies - for some reason I completely failed to notice the leading underscore until I saw you refer to this as a private variable in the What's New note.That means the note only needs to go in the NEWS file for the benefit of maintainers, rather than in the public porting notes. Sorry for overcomplicating things :)Aside from my confusion about this actually being a private interface, the patch looks good to me.
msg281333 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-11-21 08:26
New changesetd2dd6578aa16 by Serhiy Storchaka in branch 'default':Issue#28748: Private variable _Py_PackageContext is now of type "const char *"https://hg.python.org/cpython/rev/d2dd6578aa16
msg281334 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-11-21 08:27
Thanks Nick.
History
DateUserActionArgs
2022-04-11 14:58:39adminsetgithub: 72934
2017-03-31 16:36:10dstufftsetpull_requests: +pull_request856
2016-11-21 08:27:08serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: +msg281334

stage: patch review -> resolved
2016-11-21 08:26:12python-devsetnosy: +python-dev
messages: +msg281333
2016-11-21 08:18:13ncoghlansetmessages: +msg281331
2016-11-20 19:54:37serhiy.storchakasetfiles: +_Py_PackageContext-const-2.patch

messages: +msg281298
2016-11-20 14:21:12ncoghlansetmessages: +msg281266
2016-11-20 09:32:00serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp