On Aug 29, 10:30 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > castironpi <[EMAIL PROTECTED]> wrote: > > >CMIIW correct me if I'm wrong, I don't think that pack_into returns a > >value the way that pack does. > > Sorry, I was not aware that struct.pack_into and struct.unpack_from already > existed (they were added in Python 2.5). I thought you were proposing them > as new additions. > > Because of that, the rest of my post doesn't make much sense. > -- > Tim Roberts, [EMAIL PROTECTED] > Providenza & Boekelheide, Inc.
I was a lot less enthusiastic too when I discovered 'PyObject_AsWriteBuffer'. Nevertheless I think it could be instructive as well as a benefit. The ctypes conversion, cast( buffer_p + offset ), is a bit of a kludge. With the introduction of 'namedtuple' type, I think it falls right in line with the direction Python is going in. It might suffice to merely expose the 'offset' member of the items in the array of 'formatcode'. Though, the addition of the dictionary to lookup offsets by field name could offset the benefit somewhat. -- http://mail.python.org/mailman/listinfo/python-list