3 ms·
List of standard methods of this kind https://docs.python.org/3/library/itertools.html https://docs.python.org/3/library/itertools.html
by xenator 7y ago
List of standard methods of this kind https://docs.python.org/3/library/itertools.html https://docs.python.org/3/library/itertools.html
- tanin 7y agoYes, itertools is great. But its stblib is still much lighter than Scala's and Ruby's. Actually, that seems to be the direction/principle of Python, where it is less inclined to add a helper function. "It has been discussed ad nauseam on comp.lang.python. People seem to enjoy writing their own versions of flatten more than finding legitimate use cases that don't already have trivial solutions." from https://softwareengineering.stackexchange.com/questions/254279/why-doesnt-python-have-a-flatten-function-for-lists https://softwareengineering.stackexchange.com/questions/2542... Not that this is better or worse. It's just that, on the brevity aspect, Python code is gonna be longer.