Functional data structures in python