On May 25, 3:55 pm, William Chang <[EMAIL PROTECTED]> wrote: > Is the different behavior between __repr__ and __str__ intentional > when it comes to printing lists? Basically I want to print out a list > with elements of my own class, but when I overwrite __str__, __str__ > doesn't get called but if I overwrite __repr__, __repr__ will get > called. Is this a bug? > ...
As has been mentioned, this was a deliberate design decision. Partly to make things like str(['a', 'b, c']) less confusing. -- http://mail.python.org/mailman/listinfo/python-list