def __init__(self, msg, encoding='utf-8'):
    if not isinstance(msg, str):
        msg = msg.decode(encoding)
self.msg = msg

def __unicode__(self):
    return '{{{%s}}}' % self.msg
Python: How to force a "print" to use __unicode__ instead of __str__, or otherwise naturally "print" the message without explicitly calling unicode()