'translate (unwrap) using an optional wrapper function'

def unwrap(self, d, item):

    nopt = (lambda x: x)
    try:
        md = d.__metadata__
        pmd = getattr(md, '__print__', None)
        if (pmd is None):
            return item
        wrappers = getattr(pmd, 'wrappers', {})
        fn = wrappers.get(item[0], nopt)
        return (item[0], fn(item[1]))
    except:
        pass
    return item
