Message187499
This seems like an attractive idea. There's definitely a need for repeated unpacking with the same pattern, and I agree that putting the repetition into the pattern is suboptimal (not least from the point of view of caching structs).
One thing that feels a bit unorthogonal is that this is doing two things at once: both allowing for repetition of a pattern, and also adding the lazy iteration. I'd guess that there's also a use-case for allowing repetition but not returning an iterator; but then that's easily covered by list(iter_unpack).
+1 from me.
Hmm; the name. 'iterunpack'? 'iter_unpack'? 'unpack_stream'? 'unpack_all'?
Would we want something similar for packing, too? I guess that's effectively covered by b''.join(s.pack(item) for item in ...). |
|
Date |
User |
Action |
Args |
2013-04-21 11:23:56 | mark.dickinson | set | recipients:
+ mark.dickinson, pitrou, skrah, meador.inge, serhiy.storchaka, pconnell, isoschiz |
2013-04-21 11:23:56 | mark.dickinson | set | messageid: <1366543436.95.0.426092084487.issue17804@psf.upfronthosting.co.za> |
2013-04-21 11:23:56 | mark.dickinson | link | issue17804 messages |
2013-04-21 11:23:56 | mark.dickinson | create | |
|