Open GoogleCodeExporter opened 9 years ago
Hi,
I'm not sure that I see what the additional parameter would gain you. As you
say, instead of
datasize = s.read('int:12')
data = s.read('bytes', datasize)
you can use
data = s.read(8*datasize).bytes
or
data = s.read('bytes:{}'.format(datasize))
so I don't think you get much extra (you still need to read the datasize
separately), and I don't like to add things the the API if I can avoid it.
On the other hand, what I think would be nice is to allow something like this:
datasize, data = s.readlist('int:12=a, bytes:a')
which would allow the whole thing to happen in one step.
Original comment by dr.scott...@gmail.com
on 30 Mar 2012 at 3:11
This
datasize, data = s.readlist('int:12=a, bytes:a')
would definitely be the nicest of all.
Original comment by volker.m...@gmail.com
on 30 Mar 2012 at 3:17
See also issue 131 for a slightly different usage, for example
s.readlist('int:12=a, a*uint:8')
Original comment by dr.scott...@gmail.com
on 9 Dec 2012 at 4:07
Original issue reported on code.google.com by
volker.m...@gmail.com
on 30 Mar 2012 at 2:57