Serhiy Storchaka added the comment:

> Well, according to a quick benchmark, iter_unpack() is 3x to 6x faster than 
> the grouper() + unpack() recipe.
> (it's also a bit more user-friendly)

Yes, It's mainly because a grouper written on Python. When it will be 
implemented in C, the difference will be less. This function will be useful 
beside struct. Note that in my patch for issue17618 struct.Struct("!{}I") is 
not used.

As for extending Struct, what you think about a more powerful feature? About a 
method which returns not an iterator, but an iterable and indexable sequence. 
Here is a sample Python implementation.

----------
Added file: http://bugs.python.org/file29967/struct_array_view.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17804>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to