Preallocate? -- potentially brain dead question about performance

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Tue Feb 27 05:53:32 EST 2007


Jan Danielsson:
>    ...completely avoiding the design issue I raised altogether. Thanks!
> Exactly what I was hoping for! :-)

Another common way to do it, it may be a little slower because that
n,txt is a tuple:

items = set(int(n) for n,txt in mylist)

Bye,
bearophile




More information about the Python-list mailing list