tismer at tismer.com
Fri Jan 31 17:47:04 CET 2003
Thomas Heller wrote:
> Christian Tismer <tismer at tismer.com> writes:
[iscontainer implementation using buffer interface]
>>I'm (ab)using the fact that sequences which are
>>no containers usually support the buffer interface.
> This is worse, IMO.
> ctypes' instances support the buffer interface, whether
> they are sequences (or containers) or not.
After second thought, this is not worse, but great!
Nobody wants to see ctypes instances to be
used as containers for multiple arguments.
This is the domain of relatives of lists and tuples
and other, "plain Python" types.
Is there an object in ctypes which is meant as
a candidate for this domain? If not, then the
buffer approach is not so bad.
A buffer means something to access the interior
of an object, which means that the object has
some flat memory somewhere. If you support
buffer, I think you say you are not a container.
Even if this is cheating, I'd take this as honest
and won't take you as a parameter list. :-)
ciao - chris
More information about the Python-list