>Would anyone be able to tell me why my function below is getting stuck >in infinite recusion?
>def replace_within_node(node,oldnode,newnode): > if node is oldnode: > return newnode Without looking further, the most likely reason is that the base case is never true: ie, node is never oldnode. I would probably add print node, oldnode, newnode at the top (and maybe another print later) and then run the code on a small tree where I thought I knew what should be printed and then see where my expectation diverges from the actual. Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list