I have a set
of objects that I want to print in readable form. The objects' class overrides __str__
, which should be used for printing. However, according to this post, __repr__
is used when printing containers, which is not what I want.
The posts advice to use print "["+", ".join(l)+"]"
for lists doesn't work for sets. So what can I do?