On Thu, Nov 1, 2012 at 8:19 PM, Steven D'Aprano <[email protected]> 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]
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor