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
Petr Viktorin email@example.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.
Nick Coghlan firstname.lastname@example.org 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