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() > Ondrej> on the list/tuple/dict. If I want a nice readable > Ondrej> representation, I call str(). That's the philosophy, no? > > I think this is the case which calls for the distinction: > > >>> str(["1", "2", "3"]) > "['1', '2', '3']" > >>> str([1, 2, 3]) > '[1, 2, 3]' > > If the first case did as you suggested you couldn't distinguish it from the > second. > Look at this -- it seems to me that it should work fine.... ---- Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26) >>> str("qwer") 'qwer' >>> repr("qwer") "'qwer'"
- Sebastian Haase _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com