Jabba Laci schrieb:
Hi,

I have a list that contains custom objects. When printing the list,
I'd like to have a readable result, i.e. I'd like to see the output of
the __str__ functions. See an example below. When I call "print li", I
would like to get "[3, 5]". How to do that?

Use __repr__ instead - lists call that on their contained objects.


Diez
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to