Want to improve my code.

Ian hobson42 at gmail.com
Thu Feb 9 18:09:07 EST 2012


Hi all,

I'm using  lxml etree, and have written a routine to remove nodes in the 
parsed tree.

Typically, I load html, and remove <font> tags, so I am moving the font 
tags children up and moving the text and tail data about.  The code of 
the deleteElem routine is here  http://snipt.org/GSoo0

It troubles me that there is so much repetition in the lines that call 
joiner.

How can I improve the code?

Regards

Ian



More information about the Python-list mailing list