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

Gregory P. Smith greg at electricrain.com
Fri Aug 24 18:58:24 CEST 2007


On Thu, Aug 23, 2007 at 09:17:04PM -0700, Guido van Rossum wrote:
> 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.

this sounds good, i'll work on it today for bsddb and hashlib.

-greg


More information about the Python-3000 mailing list