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/
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com