From 404201211e0cf5187d0b706e0bd9e2cee476b3c2 Mon Sep 17 00:00:00 2001 From: harshitethic Date: Tue, 13 Oct 2026 06:40:14 +0530 Subject: [PATCH] docs: point C extension authors to implementation and legacy-porting guides --- source/guides/packaging-binary-extensions.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/guides/packaging-binary-extensions.rst b/source/guides/packaging-binary-extensions.rst index de8a9d2d6d..2b5a4fa2f7 100644 --- a/source/guides/packaging-binary-extensions.rst +++ b/source/guides/packaging-binary-extensions.rst @@ -228,6 +228,15 @@ The CPython :doc:`Extending and Embedding ` guide includes an introduction to writing a :doc:`custom extension module in C `. +For practical examples of reference-count ownership, error handling, and +creating safe extension objects, see the +`Python Extension Patterns guide `_. + +If you maintain a *legacy* C extension that must run on both Python 2 and +Python 3, the `py3c porting guide `_ +documents compatibility macros and migration steps. Python 2 has reached +end-of-life; new extensions should target supported Python 3 releases. + FIXME: Elaborate that all this is one of the reasons why you probably *don't* want to handcode your extension modules :)