Luke:
> I'm not familiar with this pattern. I will search around, but if you
> have any links or you would like to elaborate, that would be
> wonderful. :)
It's not a pattern, it's a little thing:
def line_filter(filein, params):
for line in filein:
if good(line, params):
yield extract(line, params)
That equals to this too:
def line_filter(filein, params):
return (extract(line, params) for line in filein if good(line,
params))
But probably that's not enough to solve your problem, so other people
can give you a better answer.
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list