[Python-3000] Lazy strings (was Re: Py3k release schedule worries)

Jim Jewett jimjjewett at gmail.com
Fri Jan 12 23:18:41 CET 2007


On 1/12/07, Guido van Rossum <guido at python.org> wrote:
> [Guido]
> > > I don't understand what you mean by #3 and #4; change *which* length?
> > > The phrasing of #3 using "hopefully-big-enough" and "odds" immediately
> > > makes me think "buffer overflow attack" which is a non-starter.

I think 3 and 4 are just different ways of salvaging even buggy code.
If you're ready to change the name and insist that they check before
compiling, then those options aren't needed.

> On 1/12/07, Larry Hastings <larry at hastings.org> wrote:
> > Change the length of the string.

> But IIUC the string may already have been seen by other code, right?
> This violates immutability, and that's not acceptable.

No.

IIRC, the string was rendered as soon as any code viewed it.  Since it
isn't rendered yet, nothing has viewed it previously.

> That's not the right attitude towards memory exceptions. You're
> supposed to be able to clean up in finally clauses and __del__
> methods, and all that still requires that existing objects remain
> intact.

But it is true that this may prevent rendering an object that
something *thought* was already created, unless Larry probes deeper
into the twisty passages of fallbacks.

-jJ


More information about the Python-3000 mailing list