Jean-Michel Fauth <wxjmfa...@gmail.com> added the comment: You do not get it or I do not explain it correctly.
I do not care if Py 3.3 accepts '...' ou u'...'. I'm only affraid, Py 3.3 is suffering from the same non working behaviour Python 2 is suffering. I have seen so many things... I can only use an Py2/Py3 analogy, the types beeing differnt. In Python 2, the u'...' and the unicode('...', 'coding') are not equivalent. This leads and has lead to a lot of non working code. unicode() is always working, while u'...' may not work. A lot of libs, are accepting unicode() and are failing in having to accept u'...'. That would mean in Python 3, '...' works and u'...' will not work. Once again, an *illustration* with IDLE / Py2. >>> import unicodedata as ud >>> for c in u'abc需': print ud.name(c) LATIN SMALL LETTER A LATIN SMALL LETTER B LATIN SMALL LETTER C LATIN SMALL LETTER E WITH ACUTE Traceback (most recent call last): File "<pyshell#3>", line 2, in <module> print ud.name(c) ValueError: no such name >>> # but >>> import sys >>> for c in unicode('abc需', sys.stdout.encoding): print ud.name(c) LATIN SMALL LETTER A LATIN SMALL LETTER B LATIN SMALL LETTER C LATIN SMALL LETTER E WITH ACUTE LATIN SMALL LIGATURE OE EURO SIGN >>> A course, this is actually a no problem with Py 3. I know nothing about the internal of Python. I have however noticed this guilty behaviour happen especially with non iso-8859-1 chars, valid byte string chars but equivalent chars with unicode code point > 255. Infortunately, all these chars which are so important in French. (I heared about similar problems with the mac-roman coding. I do not know the status). So, if this (u'...') works in Py 3.3, the problem can be considered as "solved". At least you have been informed about this potential issue. It still remains that this is a serious problem on Py 2. jmf ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14176> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com