update one-line-tree-in-Python