I have a simple class in python that has a __str__()
function. Like this:
class Foo(object):
def __init__():
self.name = 'something'
def __str__():
return self.name
My real class does more than that, but this is an example.
So then I do this:
a = Foo()
b = Foo()
print a
print b
print [a,b]
Except this prints:
something
something
[<Foo object at HexString>,<Foo object at HexString>]
Why is the printed version in the list not printing the str name of the instance and is there an easy way to get it to?
I've tried to see if __unicode__
is different and it is not.