<p dir="ltr">Le 15 juin 2014 02:42, "Benjamin Peterson" <<a href="mailto:benjamin@python.org">benjamin@python.org</a>> a écrit :<br>
> On Sat, Jun 14, 2014, at 15:39, Nikolaus Rath wrote:<br>
> > It seems to me that a much cleaner solution would be to simply declare<br>
> > _pyio's readinto to only work with bytearrays, and to explicitly raise a<br>
> > (more helpful) TypeError if anything else is passed in.<br>
><br>
> That seems reasonable. I don't think _pyio's behavior is terribly<br>
> important compared to the C _io module.</p>
<p dir="ltr">Which types are accepted by the readinto() method of the C io module? If the C module only accepts bytearray, the array hack must be removed from _pyio. </p>
<p dir="ltr">The _pyio module is mostly used for testing purpose, it's much slower. I hope that nobody uses it in production, the module is private (underscore prefix). So it's fine to break backward compatibilty to have the same behaviour then the C module.</p>
<p dir="ltr">Victor</p>