[Python-Dev] an idea for improving struct.unpack api
Nick Coghlan
ncoghlan at iinet.net.au
Sat Jan 8 05:50:47 CET 2005
Ilya Sandler wrote:
> item=unpack( "IIII", rec, offset)
How about making offset a standard integer, and change the signature to return a
tuple when it is used:
item = unpack(format, rec) # Full unpacking
offset = 0
item, offset = unpack(format, rec, offset) # Partial unpacking
The second item in the returned tuple being the offset of the first byte after
the end of the unpacked item.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at email.com | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.skystorm.net
More information about the Python-Dev
mailing list