Allowing zero-dimensional subscripts

Carl Banks invalidemail at
Sat Jun 10 01:38:19 CEST 2006

Fredrik Lundh wrote:
> noam's proposal is to make this work:
>  >>> x[]
> ()
> (but should it really result in an empty tuple?  wouldn't None be a bit
> more Pythonic?)

How would you index a 2-D array?  With a 2-tuple.
How would you index a 1-D array?  With a 1-tuple.
How would you index a 0-D array?  ...

Carl Banks

More information about the Python-list mailing list