Why is this slower?

Paul Rubin http
Tue Oct 6 20:11:01 CEST 2009


Joseph Reagle <reagle at mit.edu> writes:
>     inSRC = set([bio.name for bio in bios.values()])

You should use:

     inSRC = set(bio.name for bio in bios.values())

without the square brackets.  That avoids creating an intermediate list.



More information about the Python-list mailing list