Re: tuple __repr__ non-ascii characters

2013-10-31 Thread Chris Angelico
On Fri, Nov 1, 2013 at 1:59 AM, Yaşar Arabacı wrote: > Is there a better way to handle this problem? There is, but I don't know how easy it'll be. In Python 3, the repr of a tuple will show Unicode strings as Unicode. :) For what you're showing there, I'm not actually quite sure what's going on.

tuple __repr__ non-ascii characters

2013-10-31 Thread Yaşar Arabacı
Hi, while this: a = "yaşar" print a prints "yaşar" this: a = ("yaşar",) print a prints ('ya\xfear',) At first I tried decoding repr(a) with different encodings, but later I realised there is actually 4 charaters \, x, f and e in return value of repr. Therefore, I wrote this: def byte_repla