Experiment in structural typing in Python