[Zope3-dev] FreeBSD Test Results - Zope 3 / Python 2.3 - Not OK :-(

Tim Peters tim@zope.com
Thu, 23 Jan 2003 12:42:38 -0500


[Marius Gedminas]
> Even within Unicode string literals?  Why does unicode.__repr__ then
> prefer \xNN instead of \u00NN?
>
>   $ python
>   Python 2.2.2 (#1, Dec 18 2002, 10:36:37)
>   GCC 2.95.4 20011002 (Debian prerelease)] on linux2
>   Type "help", "copyright", "credits" or "license" for more information.
>   >>> u"\u00a4"
>   u'\xa4'
>   >>>

My guess is a misguided notion of efficiency on the part of unicode_repr()'s
author -- mixing hex escapes with Unicode escapes is conceptual chaos.  But
it's true that Python won't complain about a hex escape, ever.  It's like
casting a char* to a double in C <wink>.