classification
Title: Clinic: first parameter for module-level functions should be PyObject*, not PyModuleDef*
Type: behavior Stage: resolved
Components: Argument Clinic Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: larry, ncoghlan, petr.viktorin, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2016-06-16 16:33 by petr.viktorin, last changed 2016-07-07 15:21 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
0001-clinic-Switch-the-module-argument-to-PyObject.patch petr.viktorin, 2016-06-16 16:33 Patch review
Messages (4)
msg268676 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2016-06-16 16:33
Currently, Argument Clinic generates "PyModuleDef * module" for the first argument of module-level functions. But, the functions are passed the actual module object, not the ModuleDef.

The correct type to use is PyObject*, which is used for modules in the PyModule_* API.

(It turns out nothing in core Python currently uses the argument except passing it to other _impl functions, but this could change as PEP 489 is improved upon.)

The attached patch contains manual changes only. Please run `make clinic` after applying it to regenerate allll the code.
msg269934 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2016-07-07 13:32
Hello,
Is there anything I can do to help get this issue resolved?
msg269935 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-07-07 14:23
LGTM. Thank you for your contribution Petr.
msg269939 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-07-07 15:20
New changeset 870e02f86e08 by Serhiy Storchaka in branch '3.5':
Issue #27332: Fixed the type of the first argument of module-level functions
https://hg.python.org/cpython/rev/870e02f86e08

New changeset c80054ccbbd8 by Serhiy Storchaka in branch 'default':
- Issue #27332: Fixed the type of the first argument of module-level functions
https://hg.python.org/cpython/rev/c80054ccbbd8
History
Date User Action Args
2016-07-07 15:21:19serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2016-07-07 15:20:44python-devsetnosy: + python-dev
messages: + msg269939
2016-07-07 14:23:04serhiy.storchakasetassignee: serhiy.storchaka
type: behavior
versions: + Python 3.5
nosy: + serhiy.storchaka

messages: + msg269935
stage: commit review
2016-07-07 13:32:11petr.viktorinsetmessages: + msg269934
2016-06-16 16:33:33petr.viktorincreate