[ctypes-users] Re: Future plans for ctypes
Brought to you by:
theller
From: Thomas H. <th...@py...> - 2006-02-23 19:25:48
|
Mike C. Fletcher wrote: > Thomas Heller wrote: >> Mike C. Fletcher wrote: > ... >>> I'd suggest not including the code generator at all in the >>> Python-core package. Useful as it is, it's not AFAIK been used >>> unmodified to generate any large libraries yet. That is, it's >>> probably not yet stable in the "we're going to freeze the API sense". >> >> This is certainly true. The experiments to create decorators for >> generated code >> (cdecl and stdcall in ctypes.decorators) have failed so far, or at least >> have not brought the desired results. I plan to remove the decorators >> module >> in the next release. >> >> OTOH, code generation is used by the comtypes package to generate >> Python wrappers >> for typelibraries. comtypes subclasses both the ctypes.wrap.typedesc >> module which >> contains classes for parsed type descriptions, and subclasses >> ctypes.wrap.codegenerator >> to generate the code. >> >> Maybe it is advisable for wrapping larger libraries to create a custom >> subclass >> of the code generator as well, but only time will tell. > Certainly wound up doing it for OpenGL-ctypes. >> I'm not sure what to do: is duplicating the typedesc and >> codegenerator module >> completely into comtypes (for it's own, private use) a solution? > Given that you're relying on it at run-time, you should probably put it > into the core package. We'll likely wind up with some revisions as we > go forward, but such is life. Maybe comment the files to say "hey, this > module's APIs may change, use it as a script or risk breakage with new > versions of Python". >> I'm not keen on having comtypes depend on ctypes *plus* another >> library :-( > I'd not been aware it had a run-time dependency on it. Ok, it would not be a problem to include the complete codegenerator in comtypes. The deeper question is whether the to-be developed separate codegenerator stuff would need support in core-ctypes. Thomas |