How to Implement Recursive Data Structures in Python