[Python-Dev] marshal (was:Buffer interface in abstract.c? )
Fred L. Drake, Jr.
Fred L. Drake, Jr." <fdrake@acm.org
Fri, 13 Aug 1999 11:32:40 -0400 (EDT)
M.-A. Lemburg writes:
> Aside: Is the buffer interface reachable in any way from within
> Python ? Why isn't the interface exposed via __XXX__ methods
> on normal Python instances (could be implemented by returning a
> buffer object) ?
Would it even make sense? I though a large part of the intent was
to for performance, avoiding memory copies. Perhaps there should be
an .__as_buffer__() which returned an object that supports the C
buffer interface. I'm not sure how useful it would be; perhaps for
classes that represent image data? They could return a buffer object
created from a string/array/NumPy array.
-Fred
--
Fred L. Drake, Jr. <fdrake@acm.org>
Corporation for National Research Initiatives