This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Missing a parameter in PyEval_EvalCodeEx doc
Type: Stage: resolved
Components: Documentation Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: ammar2, docs@python, python-dev, vstinner, xiang.zhang
Priority: normal Keywords: easy, patch

Created on 2017-01-17 08:06 by xiang.zhang, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
kwdefs_docs.diff ammar2, 2017-01-17 16:22 review
kwdefs_docs.diff2 ammar2, 2017-01-18 17:16 review
kwdefs_docs.diff3 ammar2, 2017-01-20 02:43 review
kwdefs_docs.diff4 ammar2, 2017-01-20 02:54 review
Messages (8)
msg285620 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-01-17 08:06
The signature of PyEval_EvalCodeEx now gets a "PyObject *kwdefs" parameter but the doc doesn't mention it.
msg285662 - (view) Author: Ammar Askar (ammar2) * (Python committer) Date: 2017-01-17 16:22
It looks like a basic description of kwdefs was added as part of this commit: https://github.com/python/cpython/commit/7811a5d1c93f2aa0b357444eeb3f1ddc242ac57a

"keywords and defaults," however, the kwdefs argument was never added to the prototype.

I've attached a patch which adds the argument to the prototype and clarifies the language a little bit.
msg285664 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-01-17 16:36
> "keywords and defaults," however, the kwdefs argument was never added to the prototype.

I don't think this is about the missing "kwdefs". I think "arrays of arguments, keywords and defaults" is a whole part describing "PyObject **args, int argcount, PyObject **kws, int kwcount, PyObject **defs, int defcount". "kwdefs" is a dict containing the default values of keyword-only parameters in Py3? I am not sure.
msg285743 - (view) Author: Ammar Askar (ammar2) * (Python committer) Date: 2017-01-18 16:57
You're completely right, the kwdefs is referring to default arguments for keyword-only-arguments from this PEP: https://www.python.org/dev/peps/pep-3102/

Where as that line is probably referring to "defs", the defaults for normal parameters.

I'll upload an amended patch.
msg285867 - (view) Author: Ammar Askar (ammar2) * (Python committer) Date: 2017-01-20 02:43
Updated patch for review comments
msg285868 - (view) Author: Ammar Askar (ammar2) * (Python committer) Date: 2017-01-20 02:54
Updated patch to include a cross reference to keyword-only arguments since I think not everyone will know about this rather new feature.
msg285870 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2017-01-20 03:34
New changeset bb76ea32a32f by Xiang Zhang in branch '3.5':
Issue #29292: Update outdated doc of PyEval_EvalCodeEx.
https://hg.python.org/cpython/rev/bb76ea32a32f

New changeset bd121b7517ee by Xiang Zhang in branch '3.6':
Issue #29292: Merge 3.5.
https://hg.python.org/cpython/rev/bd121b7517ee

New changeset ef1146c95860 by Xiang Zhang in branch 'default':
Issue #29292: Merge 3.6.
https://hg.python.org/cpython/rev/ef1146c95860
msg285871 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-01-20 03:35
Thanks Ammar. :-)
History
Date User Action Args
2022-04-11 14:58:42adminsetgithub: 73478
2017-01-20 03:35:37xiang.zhangsetstatus: open -> closed
resolution: fixed
messages: + msg285871

stage: needs patch -> resolved
2017-01-20 03:34:46python-devsetnosy: + python-dev
messages: + msg285870
2017-01-20 02:54:54ammar2setfiles: + kwdefs_docs.diff4

messages: + msg285868
2017-01-20 02:43:08ammar2setfiles: + kwdefs_docs.diff3

messages: + msg285867
2017-01-18 17:16:19ammar2setfiles: + kwdefs_docs.diff2
2017-01-18 16:57:41ammar2setmessages: + msg285743
2017-01-17 16:36:12xiang.zhangsetnosy: + vstinner
messages: + msg285664
2017-01-17 16:22:34ammar2setfiles: + kwdefs_docs.diff

nosy: + ammar2
messages: + msg285662

keywords: + patch
2017-01-17 08:27:40xiang.zhangsetkeywords: + easy
stage: needs patch
2017-01-17 08:06:20xiang.zhangcreate