kutsurak / python-bitstring

Automatically exported from code.google.com/p/python-bitstring
0 stars 0 forks source link

Remove *format - accept iterable instead. #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm not a fan of the *format parameters used in unpack, readlist etc.

It might be better to only allow 'format', but let it be an iterable. So
instead of:

>>> a, b, c = s.unpack('hex:4', 'oct:3', 'bin:1')

make it:

>>> a, b, c = s.unpack(['hex:4', 'oct:3', 'bin:1'])

This is also in line with the change proposed to startswith and endswith.

Affects peeklist, readlist, unpack.

Original issue reported on code.google.com by python.bitstring@googlemail.com on 24 Jan 2010 at 7:06

GoogleCodeExporter commented 9 years ago
Done in revision 676.

Original comment by python.bitstring@googlemail.com on 20 Mar 2010 at 5:30