Use member names to initialize modules by radarhere · Pull Request #8734 · python-pillow/Pillow
Borrowing an idea from #5201
Rather than creating a struct with the members in order, and adding comments to describe their names,
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, };