Commiting a shape hierarchy program in Python