This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients amaury.forgeotdarc, benjamin.peterson, georg.brandl, lemburg, pitrou, schuppenies
Date 2008-06-15.13:39:09
SpamBayes Score 0.0464684
Marked as misclassified No
Message-id <1213537147.5884.3.camel@fsol>
In-reply-to <1213535934.83.0.167690904339.issue3098@psf.upfronthosting.co.za>
Content
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 :-)
History
Date User Action Args
2008-06-15 13:39:11pitrousetspambayes_score: 0.0464684 -> 0.0464684
recipients: + pitrou, lemburg, georg.brandl, amaury.forgeotdarc, benjamin.peterson, schuppenies
2008-06-15 13:39:09pitroulinkissue3098 messages
2008-06-15 13:39:09pitroucreate