[issue15903] Make rawiobase_read() read directly to bytes object

Antoine Pitrou report at bugs.python.org
Tue Sep 18 23:51:38 CEST 2012


Antoine Pitrou added the comment:

> Antoine Pitrou <report at bugs.python.org> wrote:
> > I don't think we want to expose a mutable bytes object to outside code,
> > so IMO PyMemoryView_FromMemory() is preferrable.
> 
> I agree, but PyMemoryView_FromMemory(PyBytes_AS_STRING(b), n, PyBUF_WRITE)
> just hides the fact that a mutable bytes object is exposed.

Except that the mutable bytes object is not exposed to any outside code,
so that weird behaviour can't be observed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15903>
_______________________________________


More information about the Python-bugs-list mailing list