On Thu, Nov 1, 2012 at 8:19 PM, Steven D'Aprano <steve at pearwood.info> wrote: > > s = str(self._theElements) > s = s.replace("[", "{").replace("]", "}") > return s > > > Another way is to build the string yourself: > > s = ', '.join(str(item) for item in self._theElements) > return '{' + s + '}' Or s = str(self._theElements) return "{%s}" % s[1:-1]