speed up example construction in python
allow lambdas for examples for lazy computation