On 4/18/06, Thomas Heller <[EMAIL PROTECTED]> wrote: > It is not yet too late (but the timeslot left is very small) to propose > enhancements to ctypes. classmethods like 'from_string', 'from_buffer' or > whatever would probably make sense.
A from_buffer classmethod would probably be good. I didn't think to suggest it as I recall from a long time ago on the ctypes list, a discussion which basically came to the conclusion that this wasn't needed (I think it was that discussion that resulted in the inclusion of memmove etc). But if you're not against the idea, I'd go for it - it took me a bit of thinking to get my helper function right. Also, I'm not sure if a to_string method has any value. You can use str(buffer(obj)), but I don't know if that's a good long-term solution - the buffer object has always been somewhat discouraged, AFAICT. Paul. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com