Can I define my own lazy mpmath constants, just like mpmath.pi and the others documented here? In other words, can I define a constant whose value is an mpf or mpc computed (or retrieved from memo cache) to the current precision at the time it is used (which is not necessarily the precision at the time when it is defined)? E.g. I would like this behavior: >>> from mpmath import * >>> my_lazy_one_third = MyLazyMpMathConstantSomehow(lambda: mpf(1)/3) >>> mp.dps = 15 >>> +pi mpf('3.1415926535897931') >>> +my_lazy_one_third mpf('0.33333333333333331') >>> mp.dps = 40 >>> +pi mpf('3.141592653589793238462643383279502884197169') >>> +my_lazy_one_third mpf('0.3333333333333333333333333333333333333333352') Does mpmath provide a way to do this? If not, what is the cleanest way to accomplish this using other python constructs? Continue reading...