3 ms·
> But that's largely due to Python's outputs-first sequence comprehension syntax being a mess that doesn't scale at all. Choices like wrapping a set constructo
by dragonwriter 4y ago
> But that's largely due to Python's outputs-first sequence comprehension syntax being a mess that doesn't scale at all.
Choices like wrapping a set constructor around a list comprehension rather than just using a set comprehension don't help, neither does using multiple nested no-transformation comprehensions laid out that way.
By hand, on mobile, I think this reduces to (assuming “from itertools import chain” in the file header):
tags = list({
nel
for subli in chain.from_iterables(chain(
[[jel.split('/')[2:] for jel in el]
for el in classified))
for nel in subli
if nel
})