Re: Unicode Objects in Tuples

2013-10-12 Thread Roy Smith
In article , Ned Batchelder wrote: > This idea that the repr can reconstruct the object always fell flat with > me since the vast majority of classes don't have a repr that works that > way. I look at it a little differently: the repr is meant to be as > unambiguous as possible to a develope

Re: Unicode Objects in Tuples

2013-10-12 Thread Ned Batchelder
On 10/12/13 2:20 AM, Ian Kelly wrote: On Fri, Oct 11, 2013 at 7:31 AM, Stephen Tucker 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

Re: Unicode Objects in Tuples

2013-10-11 Thread Ian Kelly
On Fri, Oct 11, 2013 at 7:31 AM, Stephen Tucker 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

Re: Unicode Objects in Tuples

2013-10-11 Thread Terry Reedy
On 10/11/2013 9:31 AM, Stephen Tucker wrote: 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

Re: Unicode Objects in Tuples

2013-10-11 Thread Piet van Oostrum
Stephen Tucker writes: > ESRI compound the problem, actually, by making all the strings that the > ArcGIS Python interface > delivers (from MS SQLServer) Unicode! (I suppose, on reflection, they have no > choice.) So I am > stuck with the worst of both worlds - a generation of Python (2.X) that

Re: Unicode Objects in Tuples

2013-10-11 Thread Steven D'Aprano
On Fri, 11 Oct 2013 09:16:36 +0100, Stephen Tucker wrote: > I am using IDLE, Python 2.7.2 on Windows 7, 64-bit. > > I have four questions: > > 1. Why is it that > print unicode_object > displays non-ASCII characters in the unicode object correctly, whereas > print (unicode_object, anot

Re: Unicode Objects in Tuples

2013-10-11 Thread Stephen Tucker
A quick reply to all you contributors (by the way, I was not expecting to get so many responses so quickly - I am (as you probably realise) new to this kind of thing. I am stuck with Python 2.X because ESRI's ArcGIS system uses it - otherwise, yes, you're all right, I would be in Python 3.X like a

Re: Unicode Objects in Tuples

2013-10-11 Thread Ned Batchelder
On 10/11/13 4:16 AM, Stephen Tucker wrote: I am using IDLE, Python 2.7.2 on Windows 7, 64-bit. I have four questions: 1. Why is it that print unicode_object displays non-ASCII characters in the unicode object correctly, whereas print (unicode_object, another_unicode_object) displays n

Re: Unicode Objects in Tuples

2013-10-11 Thread Peter Otten
Stephen Tucker wrote: > I am using IDLE, Python 2.7.2 on Windows 7, 64-bit. > > I have four questions: > > 1. Why is it that > print unicode_object > displays non-ASCII characters in the unicode object correctly, whereas > print (unicode_object, another_unicode_object) > displays non-A

Re: Unicode Objects in Tuples

2013-10-11 Thread Ben Finney
Stephen Tucker writes: > I am using IDLE, Python 2.7.2 on Windows 7, 64-bit. Python 2 is not as good at Unicode as Python 3. In fact, one of the major reasons to switch to Python 3 is that it fixes Unicode behaviour that was worse in Python 2. > I have four questions: > > 1. Why is it that […]