A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-January/050793.html below:

[Python-Dev] an idea for improving struct.unpack api

[Python-Dev] an idea for improving struct.unpack api [Python-Dev] an idea for improving struct.unpack apiNick 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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4