[Python-3000] Array typecode 'w' vs. 'u' and UCS4 builds

Travis Oliphant oliphant.travis at ieee.org
Fri Oct 12 23:37:33 CEST 2007


Christian Heimes wrote:
> Travis E. Oliphant wrote:
>> The problem is to keep the array typecodes somewhat consistent with the
>> typecodes in PEP 3118 which will be in the struct module. 
>> How about making 'U' be the typecode that translates to 'u' or 'w'
>> depending on the platform and supporting both 'u' and 'w' on all
>> platforms by appropriate translation of bytes on getting and setting?
> 
> Now I see your point. :) Your solution sounds feasible but is it
> realizable on all platforms? I once hit a thick wall of bricks during my
> work on PythonNET. I tried to make it compatible with Mono and UCS-4
> builds of Python but it was really hard because the .NET standards don't
> care about anything else than a 16bit wchar_t which doesn't even
> translate to UTF-16. I fear that 'w' may hit a similar wall on Windows.
> 

I think it would be feasible, but I'm not sure it is worth it at this 
point.   My suggestion right now (and what I've done) is to back-out the 
'w' typecode for the array module and just leave it as 'u' as before.

I'll check in this change.

-Travis


More information about the Python-3000 mailing list