Re: [Python-ideas] Suggest adding struct iter_unpack allowing mixed formats & add iter_pack

2018-01-30 Thread Greg Ewing
Steve Barnes wrote: It would be very nice if: a) iter_unpack.next produced an iterator that optionally took an additional parameter of a format string, (with endianness permitted), to replace the current format string in use. Hmmm, rather than screw around with the iterator protocol, it mi

[Python-ideas] Suggest adding struct iter_unpack allowing mixed formats & add iter_pack

2018-01-30 Thread Steve Barnes
In my work I make a lot of use of struct pack & unpack but sometimes find the fact that I either have to supply the whole format string or add position tracking mechanisms to my code explicitly so as to use pack_to or unpack_from if the structures that I am dealing with are not simple arrays of