One liners

Michael Torrie torriem at gmail.com
Sat Dec 7 18:02:27 CET 2013


On 12/07/2013 09:56 AM, Michael Torrie wrote:
>> extracols = sorted(set.union(*(set(t.data.keys()) for t in tracks))) if 
>> tracks else []
> 
> This is a generator expressions, and ternary ifs are common and often
> needed in generator expressions.

Oops. This is not a generator expression at all!



More information about the Python-list mailing list