[Stackless] Compiling stackless with PyQt4?
Jeff Senn
senn at maya.com
Mon Mar 26 16:06:03 CEST 2007
Yeah... this is one (of the *very few*) nits I have about the core of
Python.
"Note that UCS2 and UCS4 Python builds are not binary compatible.
Please keep this in mind when writing extensions or
interfaces." (http://docs.python.org/api/unicodeObjects.html)
If you are used to windows then probably this:
"On platforms where wchar_t is available and compatible with the
chosen Python Unicode build variant, Py_UNICODE is a typedef alias
for wchar_t to enhance native platform compatibility."
means that (historically) most people build with UCS2 - which IMHO is
the only sane thing to do since using
4 bytes per character for strings where 99.99% of characters need
only 2 bytes
is a highly questionable tradeoff of memory for simplification.
Python really needs an internal
Unicode string type that can efficiently deal with this issue (i.e.
properly noticing UCS-embedded
surrogates)... dunno whether anyone in python-dev land is paying
attention to this issue....
I find this: "(most recent Linux distributions come with UCS4 builds
of Python)"
somewhat depressing...
-Jas
On Mar 26, 2007, at 8:33 AM, Richard Tew wrote:
> On 3/26/07, Santiago Gala <sgala at apache.org> wrote:
>> El lun, 26-03-2007 a las 09:49 +0000, Richard Tew escribió:
>> well, the Unicode stuff is mostly because there are two different
>> ways
>> to configure python: --enable-unicode=ucs2 (two bytes unicode chars)
>> --enable-unicode=ucs4 (4 bytes unicode chars). The API they offer for
>> external extensions is different, so you need to ensure that both
>> python
>> and the modules are built with the same assumptions on the internal
>> unicode representation.
>>
>> $python -c "import sys; print sys.maxunicode"
>> 1114111
>> means --> ucs4
>>
>> ./python -c "import sys; print sys.maxunicode"
>> 65535
>> means --> ucs2
>
> Ah interesting. One of the many things just using the Windows build
> hides me from I guess.
>
> Thanks Santiago,
> Richard.
>
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless
>
_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless
More information about the Stackless
mailing list