From: <bc...@wo...> - 2002-01-11 22:33:15
|
[samuele] >I start to think that Paul Prescod is right here. > >In CPython > >Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32 >Type "copyright", "credits" or "license" for more information. >>>> unicode(u"\xe9") >u'\xe9' >>>> > >while > >Jython 2.1 on java1.3.0 (JIT: null) >Type "copyright", "credits" or "license" for more information. >>>> unicode(u"\xe9") >Traceback (innermost last): > File "<console>", line 1, in ? >UnicodeError: ascii decoding error: ordinal not in range(128) >>>> > >The question is: it is better to fail when CPython does not fails or not to >fail when >CPython fails and succeed when CPython succeeds. I'm maybe missing something >subtle but I prefer the latter and so unicode without an encoding should be a >nop. The 2.2 docs has (the 2.1 didn't) a huge special case for the single arg unicode() call. http://www.python.org/doc/current/lib/built-in-funcs.html So, yes, we could change this for 2.2 without breaking the docs. regards, finn |