Thoughts
Function that takes `["123", "456", "789"]` and needs to return `[1, 2, 3, 4, 5, 6, 7, 8, 9]`
Python:
`list(map(int, list("".join(strings))))`
Ruby
`strings.join.chars.map &:to_i`
The Ruby is just so much more readable to me. We're joining into one string, taking chars, then converting each char to a number. It's a chain of operations from left to right.
To read the Python, we start at the `""` in the middle, then read to the right, then jump to the list call, then go to the very beginning and read the `map(int`.
Edit: 1:12: needed an extra `list()` around the Python, I got an error.
Edit: 23-11-25: You could also do the Python as `from itertools import chain; list(map(int, chain.from_iterable(strings)))` which may or may not be easier to read. In which case the Ruby is `strings.map(&:chars).flatten.map &:to_i`.
Edit: 24-10-28: Simplified the last Ruby example; updated examples for consistency.