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

Christian Heimes lists at cheimes.de
Fri Oct 12 17:49:09 CEST 2007


Yesterday I found a design problem in the array module. Travis Oliphant
added a new typecode 'w' to the array module. 'w' is a wide unicode type
that is guaranteed to be at least 4 bytes long. The 'u' typecode may be
2 bytes long.

Unfortunately his change removed 'u' as a possible typecode which makes
it unnecessary hard to write code that works on Windows (UCS2 only) and
Unix (UCS4 for most Linux distributions). I've written a patch that
keeps 'u' in every build and adds 'w' as an alias for 'u' in UCS-4
builds only. It also introduces the new module variable typecodes
which is a unicode string containing all valid typecodes.

http://bugs.python.org/issue1268

Christian


More information about the Python-3000 mailing list