On Jul 25, 9:54 pm, Jeff <[EMAIL PROTECTED]> wrote:
> Look at using reduce().  You can collect information about all of the
> nodes without necessarily building a large, intermediate list in the
> process.

>From the OP's description, I assumed there'd be a list of all nodes,
from which he wishes to derive a 2nd list of specific nodes. reduce()
applies "a function of two arguments cumulatively to the items of a
sequence, from left to right, so as to reduce the sequence to a single
value", which doesn't seem to me to be what the OP was asking for. I
could understand using map() across the filter'd list, or embedding
the conditional check within the map'd function and ignoring filter(),
but at no point does the OP ask to perform any kind of function based
on two nodes...

I may have misunderstand your point, though :) Could you provide a
quick code sample to clarify?


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to