python version of post order binary tree