[issue14339] Optimizing bin, oct and hex

Martin v. Löwis report at bugs.python.org
Mon Apr 16 15:25:26 CEST 2012


Martin v. Löwis <martin at v.loewis.de> added the comment:

> (1) The patch appears to assume that a Unicode string created with
> PyUnicode_New(size, 127) will have 'kind' PyUnicode_1BYTE_KIND.
> While this might be true in the current implementation, I don't know
> whether this is guaranteed in general.  Martin, any comments on
> this?

There is a guarantee that the shortest form must always be used.
So as long as the Unicode representation doesn't fundamentally change
again, this property is indeed guaranteed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14339>
_______________________________________


More information about the Python-bugs-list mailing list