👋 Hey there, I am Waylon Walker
I am a Husband, Father of two beautiful children, Senior Python Developer currently working in the Data Engineering platform space. I am a continuous learner, and sha
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 and chain.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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.