[issue14339] Optimizing bin, oct and hex

STINNER Victor report at bugs.python.org
Wed Apr 25 00:06:27 CEST 2012


STINNER Victor <victor.stinner at gmail.com> added the comment:

2.100 -    v = PyUnicode_DecodeASCII(p, &buffer[sz] - p, NULL);
...
   2.104 +    assert(p == PyUnicode_1BYTE_DATA(v));
   2.105      return v;
   2.106  }

You may call assert(_PyUnicode_CheckConsistency(v, 1)) to ensure that the newly created string is "consistent" (see the function for the details).

----------
nosy: +haypo

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


More information about the Python-bugs-list mailing list