On 5/27/08, Greg Ewing <[EMAIL PROTECTED]> wrote: > Blake Winton wrote:
> > Seriously, I can write: > > >>> print 1, "1", Decimal("1") > > and get as my output: > > 1 1 1 > Yes, but you've explicitly told it to print that, > so presumably it's what you want in that case. > Equally, you need to be explicit about how you want > a list printed. Agreed; and that is why I consider the current behavior a bug. If you want the type information in there, then you should use repr instead of str. For example, to get get the type information for [1, "1", Decimal("1")], writing: print repr([1, "1", Decimal("1")]) is not such a huge problem. On the other hand, if you do not care about the specific types, and want to declutter the output, then writing: print ("[" + ", ".join(str(e for e in [1, "1", Decimal("1")])) + "]") is a bit more awkward in the best case -- and fails if your data structures are not all nested to exactly the same depth. Suddenly, you need to rewrite the equivalent of the pprint module. Again, what is the advantage of having str(x) be redundant to repr(x) in the case of containers? -jJ _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com