Re: [Python-Dev] Why does _pyio.*.readinto have to work with 'b' arrays?

2014-06-15 Thread Nick Coghlan
On 15 June 2014 14:57, Nikolaus Rath nikol...@rath.org wrote: On 06/14/2014 09:31 PM, Nick Coghlan wrote: On 15 June 2014 10:41, Benjamin Peterson benja...@python.org wrote: On Sat, Jun 14, 2014, at 15:39, Nikolaus Rath wrote: It seems to me that a much cleaner solution would be to simply

Re: [Python-Dev] Why does _pyio.*.readinto have to work with 'b' arrays?

2014-06-15 Thread Victor Stinner
Le 15 juin 2014 02:42, Benjamin Peterson benja...@python.org a écrit : On Sat, Jun 14, 2014, at 15:39, Nikolaus Rath wrote: It seems to me that a much cleaner solution would be to simply declare _pyio's readinto to only work with bytearrays, and to explicitly raise a (more helpful)

Re: [Python-Dev] Why does _pyio.*.readinto have to work with 'b' arrays?

2014-06-15 Thread Nikolaus Rath
Nick Coghlan ncogh...@gmail.com writes: On 15 June 2014 14:57, Nikolaus Rath nikol...@rath.org wrote: On 06/14/2014 09:31 PM, Nick Coghlan wrote: On 15 June 2014 10:41, Benjamin Peterson benja...@python.org wrote: On Sat, Jun 14, 2014, at 15:39, Nikolaus Rath wrote: It seems to me that a much

Re: [Python-Dev] Why does _pyio.*.readinto have to work with 'b' arrays?

2014-06-15 Thread Nikolaus Rath
Victor Stinner victor.stin...@gmail.com writes: Le 15 juin 2014 02:42, Benjamin Peterson benja...@python.org a écrit : On Sat, Jun 14, 2014, at 15:39, Nikolaus Rath wrote: It seems to me that a much cleaner solution would be to simply declare _pyio's readinto to only work with bytearrays,

Re: [Python-Dev] Why does _pyio.*.readinto have to work with 'b' arrays?

2014-06-14 Thread Benjamin Peterson
On Sat, Jun 14, 2014, at 15:39, Nikolaus Rath wrote: It seems to me that a much cleaner solution would be to simply declare _pyio's readinto to only work with bytearrays, and to explicitly raise a (more helpful) TypeError if anything else is passed in. That seems reasonable. I don't think

Re: [Python-Dev] Why does _pyio.*.readinto have to work with 'b' arrays?

2014-06-14 Thread Nick Coghlan
On 15 June 2014 10:41, Benjamin Peterson benja...@python.org wrote: On Sat, Jun 14, 2014, at 15:39, Nikolaus Rath wrote: It seems to me that a much cleaner solution would be to simply declare _pyio's readinto to only work with bytearrays, and to explicitly raise a (more helpful) TypeError if

Re: [Python-Dev] Why does _pyio.*.readinto have to work with 'b' arrays?

2014-06-14 Thread Nikolaus Rath
On 06/14/2014 09:31 PM, Nick Coghlan wrote: On 15 June 2014 10:41, Benjamin Peterson benja...@python.org wrote: On Sat, Jun 14, 2014, at 15:39, Nikolaus Rath wrote: It seems to me that a much cleaner solution would be to simply declare _pyio's readinto to only work with bytearrays, and to