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

Use member names to initialize modules #8734

Merged
merged 1 commit into from
Feb 6, 2025
Merged

Conversation

radarhere
Copy link
Member

Borrowing an idea from #5201

Rather than creating a struct with the members in order, and adding comments to describe their names,

Pillow/src/_imaging.c

Lines 4440 to 4446 in 2810d7c

static PyModuleDef module_def = {
PyModuleDef_HEAD_INIT,
"_imaging", /* m_name */
NULL, /* m_doc */
-1, /* m_size */
functions, /* m_methods */
};

it seems simpler to just use the member names directly.

static PyModuleDef module_def = {
    PyModuleDef_HEAD_INIT,
    .m_name = "_imaging",
    .m_size = -1,
    .m_methods = functions,
};

@hugovk hugovk merged commit a788ab3 into python-pillow:main Feb 6, 2025
52 of 53 checks passed
@radarhere radarhere deleted the module branch February 6, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants