[Python-Dev] bytes & bytearray

Paul Sokolovsky pmiscml at gmail.com
Tue Jan 20 10:48:10 CET 2015


Hello,

On Tue, 20 Jan 2015 18:15:02 +1300
Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

> Guido van Rossum wrote:
> > On Mon, Jan 19, 2015 at 11:43 AM, Paul Sokolovsky
> > <pmiscml at gmail.com <mailto:pmiscml at gmail.com>> wrote:
> > 
> >     b.lower_inplace()
> >     b.lower_i()
> > 
> > Please don't go there. The use cases are too rare.
> 
> And if you have such a use case, it's not too
> hard to do
> 
>    b[:] = b.lower()

The point of inplace operations (memoryview's, other stuff already in
Python) is to avoid unneeded memory allocation and copying. For 1Tb
bytearray with 1Tb of RAM, it will be very hard to do. (Ditto for 100K
bytearray with 150K RAM.)



-- 
Best regards,
 Paul                          mailto:pmiscml at gmail.com


More information about the Python-Dev mailing list