[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

New submission from Shreyan Avigyan shreyan.avigyan@gmail.com:
In the example code of the Extending Python with C/C++ documentation the pmodule variable (that stores the return value of PyImport_ImportModule) was never declared. The PR(s) attached to this issue fixes it by declaring and initializing the pmodule variable. This issue is common in all the documentation versions. The first PR will be for documentation version 3.10. If it's accepted then I would request other developers to submit PRs for documentation 3.9, 3.8, 3.7 and 3.6 because I'm having a problem switching to those branches (I'm continuously facing the problem "HEAD detached" if I switch to those branches).
Thanking you
With Regards
---------- assignee: docs@python components: Documentation messages: 390281 nosy: docs@python, shreyanavigyan priority: normal severity: normal status: open title: Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. type: compile error versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Change by Roundup Robot devnull@psf.upfronthosting.co.za:
---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +23946 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25207
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Shreyan Avigyan shreyan.avigyan@gmail.com added the comment:
Please have a review of my change in the documentation.
(Note: I have not signed the Python CLA because I think a simple fix in the documentation doesn't require it.)
----------
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Change by Shreyan Avigyan shreyan.avigyan@gmail.com:
---------- nosy: +gvanrossum
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Change by Guido van Rossum guido@python.org:
---------- nosy: -gvanrossum
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Shreyan Avigyan shreyan.avigyan@gmail.com added the comment:
Please have a review.
---------- type: compile error ->
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Shreyan Avigyan shreyan.avigyan@gmail.com added the comment:
I've signed the PSF CLA (as it is required) now. Please have a review.
----------
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Shreyan Avigyan shreyan.avigyan@gmail.com added the comment:
I've managed to overcome the "HEAD Detached" problem I was facing when switching to the 3.9, 3.8, 3.7 and 3.6 branches. So I'm also submitting the PRs for those documentation versions.
----------
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Change by Shreyan Avigyan shreyan.avigyan@gmail.com:
---------- pull_requests: +24063 pull_request: https://github.com/python/cpython/pull/25330
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Change by Shreyan Avigyan shreyan.avigyan@gmail.com:
---------- pull_requests: +24065 pull_request: https://github.com/python/cpython/pull/25331
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Shreyan Avigyan shreyan.avigyan@gmail.com added the comment:
Documentation versions older than 3.8 describes a different approach to import the module. Therefore those documentation versions are not to be messed with. I've attached the PRs for documentation versions 3.10, 3.9 and 3.8. Please anyone have a review of my PR as soon as possible.
Thanking you,
With Regards
---------- versions: -Python 3.6, Python 3.7
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Raymond Hettinger raymond.hettinger@gmail.com added the comment:
New changeset ea9b2d631902238acf69e51af6e3d308567b5dfd by Shreyan Avigyan in branch 'master': bpo-43739: Add type declaration Doc/extending/extending.rst example https://github.com/python/cpython/commit/ea9b2d631902238acf69e51af6e3d308567...
---------- nosy: +rhettinger
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Change by miss-islington mariatta.wijaya+miss-islington@gmail.com:
---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24066 pull_request: https://github.com/python/cpython/pull/25332
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Change by miss-islington mariatta.wijaya+miss-islington@gmail.com:
---------- pull_requests: +24067 pull_request: https://github.com/python/cpython/pull/25333
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Change by Raymond Hettinger raymond.hettinger@gmail.com:
---------- nosy: +scoder
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Raymond Hettinger raymond.hettinger@gmail.com added the comment:
New changeset 3a3c0464bd719a8cac6e52b02a3479b2834b88a4 by Miss Islington (bot) in branch '3.8': bpo-43739: Add type declaration Doc/extending/extending.rst example (GH-25332) https://github.com/python/cpython/commit/3a3c0464bd719a8cac6e52b02a3479b2834...
----------
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Raymond Hettinger raymond.hettinger@gmail.com added the comment:
New changeset 28fb2d1c4dbf16b05acfb20d457b08e049a7c83f by Miss Islington (bot) in branch '3.9': bpo-43739: Add type declaration Doc/extending/extending.rst example (GH-25333) https://github.com/python/cpython/commit/28fb2d1c4dbf16b05acfb20d457b08e049a...
----------
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________

Raymond Hettinger raymond.hettinger@gmail.com added the comment:
Thanks for the PR
---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue43739 _______________________________________
participants (5)
-
Guido van Rossum
-
miss-islington
-
Raymond Hettinger
-
Roundup Robot
-
Shreyan Avigyan