In my method i have to return a list within a list. I would like to have a list comprehension, because of the performance since the list takes about 5 minutes to create.
doc_collection = [[1, 2],
[3, 4],
[5, 6]]
result = [print(progress) or
[str(token) for token in document]
for progress, document in enumerate(doc_collection)]
print(result) # [['1', '2'], ['3', '4'], ['5', '6']]
I don't consider this good or readable code, but the idea is fun.
It works because print always returns None so print(progress) or x will always be x (by the definition of or).