[Python-Dev] adding Construct to the standard library?

Paul Moore p.f.moore at gmail.com
Tue Apr 18 23:06:37 CEST 2006


On 4/18/06, Thomas Heller <theller at python.net> 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.


More information about the Python-Dev mailing list