[Python-Dev] Re: [Numpy-discussion] Re: Numeric life as I see it

Peter Verveer verveer at embl.de
Thu Feb 10 10:53:10 CET 2005


On Feb 10, 2005, at 10:30 AM, Travis Oliphant wrote:

>
>>> One question we are pursuing is could the arrayobject get into the  
>>> core without a particular ufunc object.   Most see this as  
>>> sub-optimal, but maybe it is the only way.
>>
>>
>> Since all the artithmetic operations are in ufunc that would be  
>> suboptimal solution, but indeed still a workable one.
>
>
> I think replacing basic number operations of the arrayobject should 
> simple, so perhaps a default ufunc object could be worked out for 
> inclusion.

I agree, getting it in the core is among others, intended to give it 
broad access, not just to hard-core numeric people. For many uses 
(including many of my simpler scripts) you don't need the more exotic 
functionality of ufuncs. You could just do with implementing the 
standard math functions, possibly leaving out things like reduce. That 
would be very easy to implement.

>
>>
>>> I appreciate some of what Paul is saying here, but I'm not fully  
>>> convinced that this is still true with Python 2.2 and up new-style  
>>> c-types.   The concerns seem to be over the fact that you have to  
>>> re-implement everything in the sub-class because the base-class will 
>>>  always return one of its objects instead of a sub-class object.
>>
>>
>> I'd say that such discussions should be postponed until someone  
>> proposes a good use for subclassing arrays. Matrices are not one, in 
>> my  opinion.
>>
> Agreed.  It is is not critical to what I am doing, and I obviously 
> need more understanding before tackling such things.  Numeric3 uses 
> the new c-type largely because of the nice getsets table which is 
> separate from the methods table.  This replaces the rather ugly 
> C-functions getattr and setattr.

I would agree that sub-classing arrays might not be worth the trouble.

Peter



More information about the Python-Dev mailing list