Re: 2to3 and maketrans

2011-03-05 Thread Gregory Ewing
Martin v. Löwis wrote: Whether a GUI library is application programming or systems programming, I don't know. Neither do I, but it doesn't really matter. In my case the string is definitely text (although it will always be ascii) and therefore unicode is the right representation to use in 3.x.

Re: 2to3 and maketrans

2011-03-03 Thread Martin v. Löwis
Am 04.03.2011 03:21, schrieb Dan Stromberg: > > On Thu, Mar 3, 2011 at 3:46 PM, Martin v. Loewis > wrote: > > That depends on how you chose to represent text in 2.7. > The recommended way for that (also with 3.x in mind) > is that you should use Unicode str

Re: 2to3 and maketrans

2011-03-03 Thread Dan Stromberg
On Thu, Mar 3, 2011 at 3:46 PM, Martin v. Loewis wrote: > That depends on how you chose to represent text in 2.7. > The recommended way for that (also with 3.x in mind) > is that you should use Unicode strings to represent text. > For application programming, I'm sure Unicode is usually preferab

Re: 2to3 and maketrans

2011-03-03 Thread Martin v. Loewis
Am 03.03.2011 07:58, schrieb Gregory Ewing: > What is the recommended way to write code for 2.7 using > maketrans() on text strings in such a way that it will > convert correctly using 2to3? That depends on how you chose to represent text in 2.7. The recommended way for that (also with 3.x in mind

Re: 2to3 and maketrans

2011-03-03 Thread Dan Stromberg
On Wed, Mar 2, 2011 at 10:58 PM, Gregory Ewing wrote: > What is the recommended way to write code for 2.7 using > maketrans() on text strings in such a way that it will > convert correctly using 2to3? > > There seems to be two versions of maketrans in 3.x, one > for text and one for bytes. Code th

2to3 and maketrans

2011-03-02 Thread Gregory Ewing
What is the recommended way to write code for 2.7 using maketrans() on text strings in such a way that it will convert correctly using 2to3? There seems to be two versions of maketrans in 3.x, one for text and one for bytes. Code that references string.maketrans ends up with the one for bytes, wh