Not the point of the article, but what's the idiomatic way to generate [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]? The author's [1 for n in range(10)]? [1 for _ in range(10)]? [1]*10?
Python dev for 5 years: personally I like `[1 for _ in range(10)]` and `[1] * 10`. The `for _ in` syntax denotes the variable is basically a throwaway, whereas the `for n in` construct is a bit confusing - almost like we're supposed to be doing something with the `n` in the comprehension.
All those options are pretty idiomatic. You can also use itertools to write it as `list(it.repeat(1, 10))`. Optionally you can leave out the `list` if you don't need it (which is the main reason to use itertools).