3 ms·
> What's so hard about this? I've been programming python for quite a while, and never seen anything like main_iterator = 'abc' inner_iterator = '123'
by wisty 15y ago
> What's so hard about this?
I've been programming python for quite a while, and never seen anything like
main_iterator = 'abc'
inner_iterator = '123'
[c+n for c in main_iterator for n in inner_iterator]
It's just ugly. I guess it has its purpose (cross products?) but it's still ugly.
Once you know what that means, it's obvious what you mean by
[j for i in main_iterator for j in inner_iterator(i)]
But I've just never seen two loops crushed together like this.