Hello all,
I'm trying to make a few changes to the PWM module of RPi.GPIO 0.7.0, and
have a couple of questions:
1) Inside "PyMODINIT_FUNC PyInit__GPIO(void)" :
// Add PWM class
if (PWM_init_PWMType() == NULL)
...
Py_INCREF(&PWMType);
PyModule_AddObject(module, "PWM", (PyObject*)&PWMType);
Is there any reason (technical or otherwise) why the last two lines are not
part of the "PWM_init_PWMType()" function just above it ? Somehow I
regard that function as the initialisator of the PWM class.
2) Inside "PyTypeObject *PWM_init_PWMType(void)":
PWMType.tp_new = PyType_GenericNew;
Is there a (technical or otherwise) reason to why the "PyTypeObject PWMType
={...}" structure (just above the call) does not not just contain
"PyType_GenericNew" as the relevant element ?
Yes, I could just make the changes and do a few tests if the result will
still work (I have the feeling it will), but I can't test everything and
perhaps there are some design/readability considerations involved too. Hence
the post. :-)
Regards,
Rudy Wieser
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|