
On Wed, May 03, 2017 at 02:48:03AM +0100, Erik wrote:
On 03/05/17 01:43, Steven D'Aprano wrote:
I'm not stopping anyone from proposing a generalisation of this that works with other sequence types. As somebody did :-)
Who? I didn't spot that in the thread - please give a reference. Thanks.
https://mail.python.org/pipermail/python-ideas/2017-May/045568.html [...]
Knowing which sequence classes have a "chunk" method and which don't is a higher barrier than knowing that all sequences can be "chunked" by a single imported function.
At the moment, we're only talking about strings. That's the only actual use-case been presented so far. Everything else is at best Nice To Have, if not YAGNI. Let's not kill this idea by over-generalising it. We can always extend the idea in the future once it is proven. Or for those who really want a general purpose group-any-iterable function, it can start life as a third party module, and we can discuss adding it to the language when it is mature and the kinks are ironed out. -- Steve