Skip to content
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

gh-93741: Add private C API _PyImport_GetModuleAttrString() #93742

Merged
merged 3 commits into from Jun 14, 2022

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jun 12, 2022

It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.

Closes #93741.

It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.
Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

sqlite3 changes lgtm

@joseemanuemejiahernandez

This comment was marked as spam.

Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

LGTM

This certainly makes the affected code cleaner.

@serhiy-storchaka serhiy-storchaka merged commit 6fd4c8e into python:main Jun 14, 2022
12 checks passed
@serhiy-storchaka serhiy-storchaka deleted the get-module-attr branch Jun 14, 2022
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jun 14, 2022
…g() (pythonGH-93742)

It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.

Add also _PyImport_GetModuleAttr() which takes Python strings as arguments.
(cherry picked from commit 6fd4c8e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jun 14, 2022
…g() (pythonGH-93742)

It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.

Add also _PyImport_GetModuleAttr() which takes Python strings as arguments.
(cherry picked from commit 6fd4c8e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jun 14, 2022
…g() (pythonGH-93742)

It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.

Add also _PyImport_GetModuleAttr() which takes Python strings as arguments.
(cherry picked from commit 6fd4c8e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this issue Jun 14, 2022
…H-93742) (GH-93792)

It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.

Add also _PyImport_GetModuleAttr() which takes Python strings as arguments.
(cherry picked from commit 6fd4c8e)
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 16, 2022
…g() (pythonGH-93742) (pythonGH-93792)

It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.

Add also _PyImport_GetModuleAttr() which takes Python strings as arguments.
(cherry picked from commit 6fd4c8e)
(cherry picked from commit d42b368)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington added a commit that referenced this issue Jun 16, 2022
…H-93742) (GH-93792)

It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.

Add also _PyImport_GetModuleAttr() which takes Python strings as arguments.
(cherry picked from commit 6fd4c8e)
(cherry picked from commit d42b368)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expert-C-API skip news type-feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants