> I'm sure that is not what Marc meant. I think he simply meant a > conversion function that would return the filename as either byte or > Unicode. Get your arg from PyArg_ParseTuple, and convert it with > this function. If you have this, how do you know whether to call fopen or wfopen? If it was a byte string, you need to pass it to fopen; if it was a Unicode string, you pass it to wfopen. Maybe that's what MAL meant, but then it won't work. > Have I missed it all these years, or should we define a PyArg_ParseTuple > format that takes a "void **" and a function pointer to a type conversion > function? This is what O& does. Unless it fills a PyObject*, you have a hard time telling what it is that you got. It works for the void** case only if it always fills in the same type (e.g. Py_UNICODE*); filling int Py_UNICODE* in some cases and char* in others, without telling you, is useless. Regards, Martin
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