A possible implementation for monads in Python