[Python-3000] PyUnicodeObject implementation

"Martin v. Löwis" martin at v.loewis.de
Wed Sep 10 00:29:35 CEST 2008


> Coming back to this: Why is this done anyway? Can't the new instance of the 
> unicode-subtype just steal the buffer pointer of the already allocated unicode 
> object?

Only if the refcount of the tmp object is 1. But then, yes, it could.
You then also need to change unicode_dealloc, to only optionally release
the pointer (and probably also to not put the object into the freelist
if it doesn't have a str pointer). IOW, no :-)

Regards,
Martin


More information about the Python-3000 mailing list