[Python-3000] Immutable bytes type and bsddb or other IO

Guido van Rossum guido at python.org
Fri Aug 24 06:17:04 CEST 2007


On 8/23/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Gregory P. Smith wrote:
> > Wasn't a past mailing list thread claiming the bytes type was supposed
> > to be great for IO?  How's that possible unless we add a lock to the
> > bytesobject?
>
> Doesn't the new buffer protocol provide something for
> getting a locked view of the data? If so, it seems like
> bytes should implement that.

It *does* implement that! So there's the solution: these APIs should
not insist on bytes but use the buffer API. It's quite a bit of work I
suspect (especially since you can't use PyArg_ParseTuple with y# any
more) but worth it.

BTW PyUnicode should *not* support the buffer API.

I'll add both of these to the task spreadsheet.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list