-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C API] Add PyImport_GetModuleAttrString(mod_name, attr_name) helper function #128911
Labels
Comments
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Jan 16, 2025
Remove "pycore_import.h" includes, no longer needed.
IMO, the |
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Jan 16, 2025
* Add Modules/_testlimitedcapi/import.c * Add Lib/test/test_capi/test_import.py
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Jan 16, 2025
* Add Modules/_testlimitedcapi/import.c * Add Lib/test/test_capi/test_import.py * Remove _testcapi.check_pyimport_addmodule(): tests already covered by newly added tests.
Ok, I added PyImport_GetModuleAttr() to my PR. |
vstinner
added a commit
that referenced
this issue
Jan 17, 2025
* Add Modules/_testlimitedcapi/import.c * Add Lib/test/test_capi/test_import.py * Remove _testcapi.check_pyimport_addmodule(): tests already covered by newly added tests. Co-authored-by: Serhiy Storchaka <[email protected]>
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Jan 17, 2025
* Add Modules/_testlimitedcapi/import.c * Add Lib/test/test_capi/test_import.py * Remove _testcapi.check_pyimport_addmodule(): tests already covered by newly added tests. Co-authored-by: Serhiy Storchaka <[email protected]> (cherry picked from commit d95ba9f)
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Jan 17, 2025
* Add Modules/_testlimitedcapi/import.c * Add Lib/test/test_capi/test_import.py * Remove _testcapi.check_pyimport_addmodule(): tests already covered by newly added tests. Co-authored-by: Serhiy Storchaka <[email protected]> (cherry picked from commit d95ba9f)
vstinner
added a commit
that referenced
this issue
Jan 17, 2025
gh-128911: Add tests on the PyImport C API (#128915) * Add Modules/_testlimitedcapi/import.c * Add Lib/test/test_capi/test_import.py * Remove _testcapi.check_pyimport_addmodule(): tests already covered by newly added tests. Co-authored-by: Serhiy Storchaka <[email protected]> (cherry picked from commit d95ba9f)
serhiy-storchaka
pushed a commit
to serhiy-storchaka/cpython
that referenced
this issue
Jan 18, 2025
…nGH-128915) (pythonGH-128960) pythongh-128911: Add tests on the PyImport C API (pythonGH-128915) * Add Modules/_testlimitedcapi/import.c * Add Lib/test/test_capi/test_import.py * Remove _testcapi.check_pyimport_addmodule(): tests already covered by newly added tests. (cherry picked from commit 34ded1a) Co-authored-by: Victor Stinner <[email protected]> Co-authored-by: Serhiy Storchaka <[email protected]> (cherry picked from commit d95ba9f)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature or enhancement
Proposal:
Python has an internal
_PyImport_GetModuleAttrString(mod_name, attr_name)
helper function to import a module and get a module attribute. I propose to make this function public to be able to use it outside Python.The function is convenient to use and is used by the following files in Python:
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: