Skip to content

GH-69695: Update documentation for PyImport_ImportModule#103700

Closed
patenaud wants to merge 1 commit into
python:mainfrom
patenaud:gh69695
Closed

GH-69695: Update documentation for PyImport_ImportModule#103700
patenaud wants to merge 1 commit into
python:mainfrom
patenaud:gh69695

Conversation

@patenaud

@patenaud patenaud commented Apr 22, 2023

Copy link
Copy Markdown
Contributor

@ghost

ghost commented Apr 22, 2023

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

Comment thread Doc/c-api/import.rst
import of a module doesn't leave the module in :data:`sys.modules`.

This function always uses absolute imports.
This is a wrapper around :c:func:`PyImport_Import()` which takes a ``const char *`` as an argument instead of a ``PyObject *``.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could maybe use c:expr syntax here?

@patenaud patenaud closed this by deleting the head repository Apr 24, 2023
@arhadthedev

Copy link
Copy Markdown
Member

@patenaud If you deleted your clone by mistake, you can create a new PR after recreation.

@patenaud

patenaud commented Apr 24, 2023 via email

Copy link
Copy Markdown
Contributor Author

@arhadthedev

Copy link
Copy Markdown
Member
From 47f3a71b48ac6fd8b98e6d35abe3d9c3462a1bc0 Mon Sep 17 00:00:00 2001
From: Denis Patenaude <denis.patenaude@gmail.com>
Date: Sat, 22 Apr 2023 18:23:59 -0400
Subject: [PATCH] Update documentation for PyImport_ImportModule

---
 Doc/c-api/import.rst | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst
index a51619db6d3d..e72fd84bbfac 100644
--- a/Doc/c-api/import.rst
+++ b/Doc/c-api/import.rst
@@ -13,19 +13,7 @@ Importing Modules
       single: __all__ (package variable)
       single: modules (in module sys)
 
-   This is a simplified interface to :c:func:`PyImport_ImportModuleEx` below,
-   leaving the *globals* and *locals* arguments set to ``NULL`` and *level* set
-   to 0.  When the *name*
-   argument contains a dot (when it specifies a submodule of a package), the
-   *fromlist* argument is set to the list ``['*']`` so that the return value is the
-   named module rather than the top-level package containing it as would otherwise
-   be the case.  (Unfortunately, this has an additional side effect when *name* in
-   fact specifies a subpackage instead of a submodule: the submodules specified in
-   the package's ``__all__`` variable are  loaded.)  Return a new reference to the
-   imported module, or ``NULL`` with an exception set on failure.  A failing
-   import of a module doesn't leave the module in :data:`sys.modules`.
-
-   This function always uses absolute imports.
+   This is a wrapper around :c:func:`PyImport_Import()` which takes a ``const char *`` as an argument instead of a ``PyObject *``.
 
 
 .. c:function:: PyObject* PyImport_ImportModuleNoBlock(const char *name)

@patenaud

patenaud commented Apr 25, 2023 via email

Copy link
Copy Markdown
Contributor Author

@patenaud

Copy link
Copy Markdown
Contributor Author

Done. Newbie. Let me know if I could have done something better.

@arhadthedev

arhadthedev commented Apr 25, 2023

Copy link
Copy Markdown
Member

Newbie.

Rather not. When GitHub gives no warning that the deletion affects some open PRs, it begs for troubles sooner or later.

@AA-Turner

Copy link
Copy Markdown
Member

New PR: #103836

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants