from math import pi def get_pi(dummy): return pi class PI(object): pi = property(get_pi, doc='Constant "pi"') inst = PI() print inst.pi print PI.pi.__doc__