[Numpy-discussion] Response to PEP suggestions

Robert Kern rkern at ucsd.edu
Sat Feb 19 15:56:16 EST 2005

konrad.hinsen at laposte.net wrote:
> On 19.02.2005, at 15:28, Robert Kern wrote:
>> Except that these types probably can't be derived from the builtin  
>> int. The C layouts would have to be compatible. They'd probably have  
>> to be a separate hierarchy.
> They could all derive from a common (yet-to-be-written) base class that  
> has no data layout at all.

We then end up with the same chicken-egg problem as accepting rank-0 
integer arrays as indices. It won't work until it's in the core. If I'm 
understanding your proposition correctly, it also creates another 
problem: rank-n arrays would then pass this check, although they shouldn't.

>> True. However, if we introduce a bona fide TypeObject hierarchy for  
>> numerical scalars that *can* be profitably used outside of the array  
>> context, it's *going* to be used outside of the array context. If it  
>> gets into the
> True, though I expect its use to be limited to the numeric community.

I expect so, too. However, when considering additions to the standard 
library, python-dev has to assume otherwise. If it's going to be so 
limited in application, then something so large shouldn't be in the 
standard library.

>>  standard library, it can't just be a large number hierarchy for our  
>> use; it will have to be *the* number hierarchy for Python and include  
>> PyLongObjects and decimals and rationals.
> That would be preferable indeed.
>> And that's probably a bit more than we care to deal with to get  
>> multiarrays into the core.
> It all depends on the reaction of the Python developer community. We  
> won't know before asking.

I think it would be great to have a more thorough number hierarchy in 
the standard library. So would some others. See PEPs 228 and 242. 
However, I think that the issue is orthogonal getting an multiarray 
object into the standard library. I'm not convinced that it actually 
solves the problems with getting multiarrays into the core. Now, we may 
have different priorities, so we have different thresholds of 

Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter

More information about the NumPy-Discussion mailing list