Monads and Sums in python