Re: __str__ difficulty with lists

2009-11-01 Thread Diez B. Roggisch
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__ ins

__str__ difficulty with lists

2009-11-01 Thread Jabba Laci
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? Thanks, Laszlo == class MyNu