Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Le dimanche 15 juin 2008 à 13:18 +0000, Robert Schuppenies a écrit : > If I understand configure correctly, PY_UNICODE_TYPE is only set when > a type matching the size of $unicode_size is found. And this is set to > either 2 or 4.
Buf if PY_UNICODE_TYPE is not set in configure, unicodeobject.h tries to settle on a default value. Which turns out to be Py_UCS4 in UCS4 builds: http://hg.pitrou.net/public/py3k/py3k/file/da93fc81b086/Include/unicodeobject.h#l86 And Py_UCS4 itself will be larger than 4 bytes if the platform's int size is larger than that: http://hg.pitrou.net/public/py3k/py3k/file/da93fc81b086/Include/unicodeobject.h#l119 So if you want to be 100% correct, you should use sizeof(PY_UNICODE_TYPE) (or sizeof(Py_UNICODE), which is the same). If you don't want to, sys.maxunicode is sufficient :-) _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3098> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com