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

"Martin v. Löwis" martin at v.loewis.de
Thu Aug 23 21:18:59 CEST 2007


> I -detest- the idea of making another temporary copy of the data just
> to allow the GIL to be released during IO.  data copies == bad.
> 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?  (Its not -likely- that bytes objects will be modified
> while in use for IO in most circumstances but just the possibility
> that it could be is a problem)

I agree. There must be a way to lock a bytes object from modification,
preferably not by locking an attempt to modify it, but by raising an
exception when a locked bytes object is modified.

(I do realise that this gives something very close to immutable bytes
objects).

Regards,
Martin


More information about the Python-3000 mailing list