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: Clinic: Converting Your First Function is not up to date
Type: enhancement Stage: resolved
Components: Argument Clinic, Documentation Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, larry, mdk, python-dev, vstinner
Priority: normal Keywords: patch

Created on 2016-11-20 16:44 by mdk, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue28753.diff mdk, 2016-11-20 18:14 review
larry.issue28753.diff larry, 2016-11-20 18:48 review
issue28753.fastcall.diff mdk, 2016-11-25 00:30 review
Messages (12)
msg281281 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2016-11-20 16:44
It looks like the "Converting Your First Function" has been written with clinic-generated C code interspersed with user C code. But it looks like nowadays a `clinic/{}.c.h` file is generated, so the "Converting Your First Function" should tell us to add the `#include "clinic/…`.

Also, the documentation states:

> If any of these items differ in any way, adjust your Argument
> Clinic function specification and rerun Tools/clinic/clinic.py
> until they are the same.

But since `METH_FASTCALL` it may be wrong (Clinic generated `METH_FASTCALL` but it was `METH_VARARGS|METH_KEYWORDS`).
msg281286 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2016-11-20 17:12
The bit about the "clinic/_" include is a good point.  Care to write a doc patch?

The bit about FASTCALL I don't know anything about because I haven't worked with FASTCALL.  I've added Victor Stinner, the author of the FASTCALL patch, maybe he can address your concerns about FASTCALL.
msg281290 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2016-11-20 18:14
@Larry: As a french-speaking guy, I typically don't write non-internal doc in english, fearing it sound weird for natives. I prefer translating it back in french (I'm the current leader of https://github.com/afpy/python_doc_fr)

Here, here is a patch.
msg281293 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2016-11-20 18:48
I understand your concern as a non-English speaker, but your patch was really pretty good.  I did edit it a little; how's this?
msg281294 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2016-11-20 19:28
Thanks for proof-reading my english, your editions are really nice: LGTM.
msg281295 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-11-20 19:33
New changeset 0a18d2cfeb52 by Larry Hastings in branch 'default':
Issue 28753: Argument Clinic howto docfix, courtesy Julien Palard.
https://hg.python.org/cpython/rev/0a18d2cfeb52
msg281296 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2016-11-20 19:35
Should we keep this open for the FASTCALL bit?
msg281297 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2016-11-20 19:35
Let's see what Victor has to say.
msg281563 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2016-11-23 13:32
Reopening to remind @Victor we have a question about METH_FASTCALL.
msg281672 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2016-11-25 00:30
After a discussion with Victor, I propose a patch to update the documentation allowing users strictly following the doc to let Clinic use FASTCALLs, it's a nice performance gain, and it's safe to let clinic use it.
msg281684 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-11-25 08:15
issue28753.fastcall.diff LGTM.
msg282825 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-12-10 04:23
New changeset 7a93d1a0a1cf by Martin Panter in branch '3.5':
Issue 28753: Argument Clinic howto docfix, courtesy Julien Palard.
https://hg.python.org/cpython/rev/7a93d1a0a1cf

New changeset d0859a11322c by Martin Panter in branch '3.6':
Issues #28755, #28753: Merge Arg Clinic howto from 3.5
https://hg.python.org/cpython/rev/d0859a11322c
History
Date User Action Args
2022-04-11 14:58:39adminsetgithub: 72939
2016-12-11 19:26:14mdksetstatus: open -> closed
2016-12-10 04:23:13python-devsetmessages: + msg282825
2016-11-25 08:15:58vstinnersetmessages: + msg281684
2016-11-25 00:30:48mdksetfiles: + issue28753.fastcall.diff

messages: + msg281672
2016-11-23 13:32:59mdksetstatus: closed -> open

messages: + msg281563
2016-11-20 19:35:57larrysetmessages: + msg281297
2016-11-20 19:35:11mdksetmessages: + msg281296
2016-11-20 19:33:49larrysetstatus: open -> closed
resolution: fixed
stage: resolved
2016-11-20 19:33:32python-devsetnosy: + python-dev
messages: + msg281295
2016-11-20 19:28:19mdksetmessages: + msg281294
2016-11-20 18:48:50larrysetfiles: + larry.issue28753.diff

messages: + msg281293
2016-11-20 18:14:48mdksetfiles: + issue28753.diff
keywords: + patch
messages: + msg281290
2016-11-20 17:12:27larrysetnosy: + vstinner
messages: + msg281286
2016-11-20 16:46:29mdksetassignee: docs@python

type: enhancement
components: + Documentation
nosy: + docs@python
2016-11-20 16:44:45mdksetversions: + Python 3.7
2016-11-20 16:44:38mdksetnosy: + larry

components: + Argument Clinic
versions: + Python 3.6
2016-11-20 16:44:04mdkcreate