TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: R.WIESER
date: 2019-12-02 13:27:00
subject: RPi.GPIO-0.7.0 - a few qu

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)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.