[XML-SIG] Re: Mr. Nitpicker looks at saxlib

Fredrik Lundh fredrik@pythonware.com
Fri, 29 May 1998 11:06:42 +0100


>> |   but it has one serious drawback: the string slicing operator
>> |   copies the string, 
>> 
>> Just a thought: should that be changed, since strings are supposed to
>> be mutable anyway and this is such a common operation?

immutable

>This is difficult. I looked into this a few years ago (add a "parent" pointer 
>to the string object and incref the parent when you refer to parts of its 
>string), but it had the serious disadvantage that the parent string would 
>never be released as long as it had any children. This is quite common. And 
>then we got string interning which basically killed the whole idea.
>
>However: isn't it possible to be intelligent about the slicing, i.e. only do 
>the slice if necessary?

In the context of saxlib, or generally?  How to you define "if necessary"?

Cheers /F