xml.etree - why no HTMLTreeBuilder included?

2010-09-26 Thread Jon P.
It is great that Fredrik Lundh's ElementTree is now a part of the Python Standard Library. However, Is it correct that if you want to use xml.etree.ElementTree to parse an HTML Document that you will have to install a separate HTMLTreeBuilder (e.g. TidyHTMLTreeBuilder) and that the only TreeBuilde

substituting list comprehensions for map()

2009-11-01 Thread Jon P.
I'd like to do: resultlist = operandlist1 + operandlist2 where for example operandlist1=[1,2,3,4,5] operandlist2=[5,4,3,2,1] and resultlist will become [6,6,6,6,6]. Using map(), I can do: map(lambda op1,op2: op1 + op2, operandlist1, operandlist2) Is there any reasonable way to do this via a