Re: [Python-Dev] str(container) should call str(item), not repr(item)

2008-07-28 Thread Aahz
On Mon, Jul 28, 2008, Ondrej Certik wrote: > > as discussed before here: > > http://mail.python.org/pipermail/python-3000/2008-May/013876.html Precisely because this has been discussed extensively with little to show, I recommend that any further discussion be held on either python-ideas or comp

Re: [Python-Dev] str(container) should call str(item), not repr(item)

2008-07-28 Thread Steve Holden
Sebastian Haase wrote: On Mon, Jul 28, 2008 at 10:59 AM, <[EMAIL PROTECTED]> wrote: Ondrej> i.e. the str on list (and tuple and dict) calls repr() on the Ondrej> elements, instead of str. This really seems to me like a bug. Ondrej> Because if I wanted the repr() representation, I'd cal

Re: [Python-Dev] str(container) should call str(item), not repr(item)

2008-07-28 Thread Matt Giuca
Another disadvantage of calling str recursively rather than repr is that it places an onus on anyone writing a class to write both a repr and a str method (or be inconsistent with the newly-accepted standard for container types). I personally write a repr method for most classes, which aids debugg

Re: [Python-Dev] str(container) should call str(item), not repr(item)

2008-07-28 Thread Sebastian Haase
On Mon, Jul 28, 2008 at 10:59 AM, <[EMAIL PROTECTED]> wrote: > >Ondrej> i.e. the str on list (and tuple and dict) calls repr() on the >Ondrej> elements, instead of str. This really seems to me like a bug. >Ondrej> Because if I wanted the repr() representation, I'd call repr() >Ondr

Re: [Python-Dev] str(container) should call str(item), not repr(item)

2008-07-28 Thread Oleg Broytmann
On Mon, Jul 28, 2008 at 10:28:34AM +0200, Ondrej Certik wrote: > http://mail.python.org/pipermail/python-3000/2008-May/013876.html The PEP is pep-3140: http://python.org/peps/pep-3140.html and it has been rejected. To revive it we need better, more compelling arguments. We also need a plan for

Re: [Python-Dev] str(container) should call str(item), not repr(item)

2008-07-28 Thread skip
Ondrej> i.e. the str on list (and tuple and dict) calls repr() on the Ondrej> elements, instead of str. This really seems to me like a bug. Ondrej> Because if I wanted the repr() representation, I'd call repr() Ondrej> on the list/tuple/dict. If I want a nice readable Ondrej> r

[Python-Dev] str(container) should call str(item), not repr(item)

2008-07-28 Thread Ondrej Certik
Hi, as discussed before here: http://mail.python.org/pipermail/python-3000/2008-May/013876.html if you do: >>> from decimal import Decimal >>> a = Decimal(40) >>> print a, a**2, a**3 40 1600 64000 >>> print [a, a**2, a**3] [Decimal("40"), Decimal("1600"), Decimal("64000")] >>> print {a: 3} {Dec