On Tue, 17 Dec 2019 17:48:34 +0000, Pancho
declaimed the following:
>For what it is worth I suspect some contributors to the group have many
>decades professional experience. In a professional context more would be
>expected of you. For instance I would have expected you to look up what
>PyType_GenericNew was and to know it was a function and hence that the
>field tp_new was function pointer. However I don't think that is a
>reasonable expectation in a group dedicated to an introductory learning
>device, which is what the RPi is designed to be, even if that isn't what
>a lot of us do with them.
>
OTOH -- someone attempting to modify a /provided/ library that relies
upon the Python embedded/extension API has gone far beyond "introductory
learning" situation. Many people have used Python for decades and never had
need to study the C-layer API. That layer almost demands one to have a good
understanding of how Python works from the inside, and also crosses from
Python to C.
I'd like to point out "C". NOT "C++". There are no "classes" native to
the C layer; there are just structures being used to represent Python-level
objects (classes, aka "types").
As an aside -- I'm pondering if the reason the .tp_new field of the PWM
structure wasn't pre-populated with PyType_GenericNew may have been to
support future subclassing -- with a variant that might need additional
set-up (current PWM is a software output, possibly a future R-Pi may
incorporate hardware PWM on some pins, and creating a PWM object would
differ based upon which pin was specified, and hence need a different "new"
operation).
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|