[issue26515] Update extending/embedding docs to new way to build modules in C

New submission from Brett Cannon:
https://docs.python.org/3/extending/extending.html#a-simple-example uses PyModule_Create() instead of PyModuleDef_Init().
---------- assignee: docs@python components: Documentation messages: 261398 nosy: brett.cannon, docs@python, eric.snow, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Update extending/embedding docs to new way to build modules in C versions: Python 3.5, Python 3.6
_______________________________________ Python tracker report@bugs.python.org http://bugs.python.org/issue26515 _______________________________________

Change by Berker Peksag berker.peksag@gmail.com:
---------- keywords: +patch pull_requests: +8177 stage: needs patch -> patch review
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue26515 _______________________________________

Change by Berker Peksag berker.peksag@gmail.com:
---------- nosy: +berker.peksag type: -> enhancement versions: +Python 3.7, Python 3.8 -Python 3.5
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue26515 _______________________________________

Change by STINNER Victor vstinner@redhat.com:
---------- nosy: +petr.viktorin
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue26515 _______________________________________

Petr Viktorin encukou@gmail.com added the comment:
Correct usage of multi-phase init might now get users stuck when they start needing per-module state. See PEP 573 "Module State Access from C Extension Methods" for the (hopefully) last thing that prevents me from generally recommending multi-phase init.
That PEP is on my list for after PRP 590 is done. Before it's implemented, I'm happy leaving PyModuleDef_Init to experts -- that is, have it in the reference docs only.
----------
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue26515 _______________________________________

Nick Coghlan ncoghlan@gmail.com added the comment:
Changed target version as per Petr's comment (PEP 573 is close to being accepted for 3.9 - it just needs some editing to improve clarity in the PEP itself, rather than needing any changes to the technical proposal)
---------- versions: +Python 3.9 -Python 3.6, Python 3.7, Python 3.8
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue26515 _______________________________________

Petr Viktorin encukou@gmail.com added the comment:
There is now PEP 630. Still not done enough to move it out of draft status, but usable for converting simple modules.
----------
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue26515 _______________________________________

Petr Viktorin encukou@gmail.com added the comment:
PEP 630 is now Active. I believe the vast majority of modules can now be ported, and it should be helpful for early adopters (including CPython stdlib). But there are still Open Issues and the API not battle-tested on all the edge cases.
The PEP is written to be easily integrated into official docs when the time comes.
----------
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue26515 _______________________________________
participants (5)
-
Berker Peksag
-
Brett Cannon
-
Nick Coghlan
-
Petr Viktorin
-
STINNER Victor