[SciPy-dev] Re: [Numpy-discussion] Suggested Addition to the new array PEP

Travis Oliphant oliphant at ee.byu.edu
Sat Jul 30 21:29:16 EDT 2005


Chris Barker wrote:

> Hi all, but particularly Travis,
>
> I just took the time to read the new array PEP:
>
> http://numeric.scipy.org/PEP.txt
>
> It looks great.
>
> I do have one suggestion for an addition method:
>
> change_type(NewType) # or some other name:
>
> Change the type that the bytes in the array represent, without 
> changing the data at. Dimensions will change if the new type has a 
> different itemsize than the old.
>
Actually, I think this functionality is supported by attribute assignment. 

Anyway,  it is a good suggestion and one that should be supported ( I 
know I wanted it to be supported at some time, I don't know if it is).

>
> By the way, I'm also not seeing tostring() or tobuffer() listed in the 
> PEP


The are still there just attributes now...

a.data     is always a buffer object
a.data[:]  is a string (because [:] on a buffer object always produces 
the string)





More information about the SciPy-Dev mailing list