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

Reply via email to