Kristján Valur Jónsson wrote: > What are the semantics of the "type" argument for PyCObject_FromVoidPtr()? > From the patch, from the documentation comment above the prototype for PyCObject_FromVoidPtr() in Include/cobject.h: The "type" string must point to a legal C string of non-zero length, > -Does it do a strdup, or is the type required to be valid while the object exists (e.g. a static string)? > From the patch, continuing on from where we just left off: and this string must outlive the CObject. > -How is the type match determined, strcmp, or pointer comparison? From the patch, observing the code in the static function _is_legal_cobject_and_type() in Objects/cobject.c: if (!type || !*type) { PyErr_SetString(PyExc_TypeError, invalidType); return 0; } if (strcmp(type, self->type)) { PyErr_SetString(PyExc_TypeError, incorrectType); return 0; } A method for answering further such questions suggests itself, /larry// /
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4