How to remove subset from a file efficiently?

Steve Holden steve at holdenweb.com
Thu Jan 12 18:34:33 EST 2006


Fredrik Lundh wrote:
> Steve Holden wrote:
> 
> 
>>>looks like premature non-optimization to me...
>>>
>>
>>It might be quicker to establish a dict whose keys are the barred
>>numbers and use that, rather than a list, to determine whether the input
>>numbers should make it through.
> 
> 
> what do you think
> 
> 
>>        barred = set(open('/home/sjd/python/wip/CBR0000319.dat'))
> 
> 
> does ? ;-)
> 
:-}

Duh.
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list