[Python-Dev] Fixing _PyEval_SliceIndex so that integer-like objects can be used

Guido van Rossum gvanrossum at gmail.com
Sat Feb 19 00:49:44 CET 2005

> > then how about if arrayobjects can make it in the core, then a check for
> > a rank-0 integer-type
> > arrayobject is allowed before raising an exception?

Sure, *if* you can get the premise accepted.

> Following up on Bob's point, maybe making rank-0 integer type
> arrayobjects inherit from int has some mileage?  Somewhat weird,
> but...

Hm, currently inheriting from int would imply that the C-level memory
lay-out of the object is an extension of the built-in int type. That's
probably too much of a constraint. But perhaps somehow
rank-0-integer-array and int could be the same type? I don't think it
would hurt too badly if an int had a method to find out its rank as an
array. And I assume you can't iterate over a rank-0 array, right?

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list