On 5/25/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Raymond Hettinger wrote:
>
> > IIRC, Skip had developed a smart  version that returned lazy string
> > objects that kept a reference and pointers to the original string
> > (instead of making its own copy of the string components).  The string
> > subclass would expand itself and free the reference if necessary for a
> > subsequent string operation.  The main purpose was to handle the cases
> > where one fragment of the other was never used or just had a length
> > check.  Also it was helpful when partition was used lisp-style to
> > repeatedly break-off head/tail fragments.
>
> that sounds nice in theory, but I completely fail to see how that can be
> implemented without ripping out the existing string object and replacing
> it with something entirely different, or (via horrible macro tricks)
> slow down virtually all other use of PyStringObject.
>
> skip?  was this a real design or a Py3K bluesky idea?

I suggest to forget about that particular idea and just do what you
were thinking of originally. str.partition() and unicode.partition()
should be as simple as possible, to cover the 80% use case FAST.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to