我知道连接字符串列表的pythonic方法是使用
l =["a", "b", "c"] "".join(l)
但是,如果我有一个包含字符串(作为属性)的对象列表,而不重新分配字符串,我该怎么做呢?
我想我可以实施 __str__(self) .但这是我不愿意使用的解决方法.
__str__(self)
python string list object
list ×1
object ×1
python ×1
string ×1