In Python, posso fare:
>>> list = ['a', 'b', 'c']
>>> ', '.join(list)
'a, b, c'
C'è un modo semplice per fare lo stesso quando ho un elenco di oggetti?
>>> class Obj:
... def __str__(self):
... return 'name'
...
>>> list = [Obj(), Obj(), Obj()]
>>> ', '.join(list)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: sequence item 0: expected string, instance found
O devo ricorrere a un ciclo for?