[Python-Dev] Re: _PyUnicode_New/PyUnicode_Resize

M.-A. Lemburg mal@lemburg.com
Thu, 06 Apr 2000 10:50:47 +0200


Guido van Rossum wrote:
> 
> > E.g. say Unicode gets interned someday, then resize will
> > need to watch out not resizing a Unicode object which is
> > already stored in the interning dict.
> 
> Note that string objects deal with this by requiring that the
> reference count is 1 when a string is resized.  This effectively
> enforces that resizes are only used when the original creator is still
> working on the string.

Nice trick ;-)

The new PyUnicode_Resize() will have the same interface as
_PyString_Resize() since this seems to be the most flexible
way to implement it without giving away possibilities for
future optimizations...

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/