[Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Jun 10 08:15:19 CEST 2006

Nick Coghlan wrote:

> I think it more comes from the n-dimensional array approach - 'n=0' is 
> then a natural issue to consider.

But only if it makes sense. I still think there are some
severe conceptual difficulties with 0D arrays. One is
the question of how many items it contains. With 1 or
more dimensions, you can talk about its size along any
chosen dimension. But with 0 dimensions there's no size
to measure. Who's to say a 0D array has a size of 1, then?
Part of my brain keeps saying it should be 0 -- i.e.
it contains nothing at all!

Also, what kind of thing does a[] yield? Do we finally,
at last, get an actual scalar, or do we get a -1 dimensional
array? :-)

I'm having trouble seeing a real use for a 0D array as
something distinct from a scalar, as opposed to them
just being an oddity that happens to arise as a side
effect of the way Numeric/Numpy are implemented.


More information about the Python-Dev mailing list