[Numpy-discussion] Latest Array-Interface PEP

Travis Oliphant oliphant at ee.byu.edu
Thu Jan 4 17:19:14 CST 2007


>> PyArrayView_FromObject(obj)
>>     
>
> yes, that's what I'm looking for -- please do add that to the C-API
>
>   
>>> By the way,, how compatible is this with the existing buffer protocol?
>>>   
>>>       
>> It's basically orthogonal.  In other-words, if you defined the array 
>> view protocol you would not need the buffer protocol at all.  But you 
>> could easily define both.
>>     
>
> OK, so if one of these were passed into something expecting the buffer 
> protocol, then it wouldn't work, but you could make an object conform to 
> both protocols at once -- like numpy does now, I suppose -- very nice.
>
> Another question -- is this new approach in response to feedback from 
> Guido and or other Python devs? This sure seems like a good way to go -- 
> though it seems from the last discussion I followed at python-dev, most 
> of the devs just didn't get how useful this would be!
>   
The new approach is a response to the devs and to Sasha who had some 
relevant comments.  Yes, I agree that many devs don't "get" how useful 
it would be because they have not written scientific or 
graphics-intensive applications.   However, Guido is the one who 
encouraged me at SciPy 2006 to push this and so I think he is generally 
favorable to the idea.  The Python devs will definitely push back.  The 
strongest opposition seems to be from people that don't 'get' it and so 
don't want "dead interfaces" in Python. 

They would need to be convinced of how often such an interface would 
actually get used.  I've tried to do that in the rationale, but many 
people actually posting to python-dev to support the basic idea (you 
don't have to support the specific implementation --- most are going to 
be uncomfortable knowing enough to make a stand).  However, there is a 
great need for people to stand up and say:  "We need something like this 
in Python..."

-Travis



More information about the Numpy-discussion mailing list