struct.Struct lets you encode Python objects into structured memory.
It accepts a format string, and optionally a buffer and offset to/from
which to read/write the structure.  What do you think of random access
for the results?

(unproduced)
>>> packer= struct.Struct( 'IIIf255p' )
>>> packer.pack_into( buf, off, 10, 20, 30, 0.5, 'abc' )
>>> packer.unpack_from( buf, off, 2 ) #reads field 2
30

Does this take a PEP, or just a patch submission?
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to