Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #56725

Re: Unicode Objects in Tuples

References <CAP=-cKU6Xkt_rm4VYh7NfXLSfUDG7FZQXHz+U12gP6fbkdhxbQ@mail.gmail.com> <5257C35C.4070407@nedbatchelder.com> <CAP=-cKVJ10KmWCnc8-86KabXL=EmCSUJpO=jDVBpXmRPH1hHBg@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2013-10-12 00:20 -0600
Subject Re: Unicode Objects in Tuples
Newsgroups comp.lang.python
Message-ID <mailman.1028.1381558852.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Oct 11, 2013 at 7:31 AM, Stephen Tucker <stephen_tucker@sil.org> wrote:
> On the original question, well, I accept Ned's answer (at 10.22). I also
> like the idea of a helper function given by Peter Otten at 09.51. It still
> seems like a crutch to help poor old Python 2.X to do what any programmer
> (or, at least the programmers like me :-)  ) think it ought to be able to by
> itself. The distinction between the "geekiness" of a tuple compared with the
> "non-geekiness" of a string is, itself, far too geeky for my liking. The
> distinction seems to be an utterly spurious - even artificial or arbitrary
> one to me. (Sorry about the rant.)

I agree, and that's not how I would explain the distinction.  The str
of an object is meant to be human-readable, while the repr of an
object is meant to be something that could be pasted into the
interpreter to reconstruct the object.  In the case of tuples, the
repr of the tuple uses the reprs of the components because the
resulting string will more likely be acceptable to the interpreter,
and the str of the tuple is the same as the repr because there is no
convincing reason why it should be different.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Unicode Objects in Tuples Ian Kelly <ian.g.kelly@gmail.com> - 2013-10-12 00:20 -0600

csiph-web