>>> >>> class PrefixStr: ... def __init__(self, prefix): ... self.prefix = prefix ... def __getattr__(self, s): ... return self.prefix+s ... >>> >>> q = PrefixStr('xyz_') >>> >>> { q.height:11, q.width:7, q.depth:3 } {'xyz_width': 7, 'xyz_depth': 3, 'xyz_height': 11} >>>