The python itertools module is a collection of tools for handling iterators. I want to make an honest effort to break the habit of repetitive stand...
For further actions, you may consider blocking this person and/or reporting abuse
I am a big fan of replacing nested loops with itertools/more itertools. I often use more_itertools.flatten, I was curios what the difference was between
flatten
andchain.from_iterables
so I opened up a repl and found this.I'll argue that
flatten
is more readable and likely that folks will understand what it is doing intuitively when they read my code, but it comes at the cost of an extra dependency.I nice way to chain two sequences is unpacking them in a list literal. 😍