'Pretty printing for assignments. {\'x\', \'u\'} appears as \'g[u/x]\''

def __str__(self):

    gstring = u'g'
    variant = sorted(self.variant)
    for (val, var) in variant:
        gstring += (u'[%s/%s]' % (val, var))
    return gstring
