[Python-Dev] Re: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.197, 2.198

M.-A. Lemburg mal at lemburg.com
Thu Sep 18 03:23:44 EDT 2003


Martin v. Löwis wrote:
> "M.-A. Lemburg" <mal at lemburg.com> writes:
> 
>>No question there, but wouldn't it be easier to test such a platform
>>and then fallback to "unigned int" in case wchar_t is found to
>>be a signed value ?
> 
> Why is it important that Py_UNICODE is unsigned?

Because that's what was used as basis in the type implementation
as well as the codecs (internal and external). Comparisons simply
work differently when you're using a signed type which is also
why most compilers warn about this -- but you know that.

An signed type also doesn't make much sense for things like
character storage -- the sign information is useless and you
lose a bit for each character.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Software directly from the Source  (#1, Sep 18 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::




More information about the Python-Dev mailing list