On Tue, 3 Dec 2019 08:01:13 +0100, "R.Wieser"
declaimed the following:
>
>As far as I can (now) tell, the "PWMType.tp_new = PyType_GenericNew;" line
>creates a single instance and stores it, which than is referenced in all
Neither... cf: https://docs.python.org/3/c-api/type.html (and related)
"""
newfunc PyTypeObject.tp_new
An optional pointer to an instance creation function.
"""
"""
PyObject* PyType_GenericNew(PyTypeObject *type, PyObject *args, PyObject
*kwds)
Return value: New reference.
Generic handler for the tp_new slot of a type object. Create a new
instance using the type’s tp_alloc slot.
"""
It appears to be saving "genericnew" AS the function to be used later
when the instance is actually created. Somewhere (possibly in the C
extension API itself) PWMType.tp_new needs to be called (with arguments) to
actually make the object.
--
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)
|