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

Larry Hastings larry at hastings.org
Sat Jan 13 10:16:39 CET 2007


Guido van Rossum wrote:
> Experiment, see what results in the cleanest code in typical usage.
I experimented, and surprise! it's the API we already have.  Returning 
both "p" and "len" was only helpful for the ill-fated "options #3 and 
#4"; once that requirement dropped away, the best approach became that 
old C chestnut, the inline assignment:

    if ((p = PyUnicode_AS_UNICODE(self)) == NULL)
       return fail_or_whatever();

So I guess I consider the patch ready for initial review as-is.

Not ready for /acceptance,/ of course; there's plenty more work to do, 
fixing up the callees and finding a better name for the above macro.  
But I'll hold off on that for now following the principle of "lazy 
improvement".

Cheers,


/larry/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20070113/2be48523/attachment.html 


More information about the Python-3000 mailing list