| 73 | | more to come |
| | 74 | Everyone who commented liked this feature, so as of changeset:1871 any number of ellipses and newaxis tokens can |
| | 75 | be placed as a subscript argument for a zero-rank array. For example: |
| | 76 | {{{ |
| | 77 | >>> x = array(1) |
| | 78 | >>> x[newaxis,...,newaxis,...] |
| | 79 | array([[1]]) |
| | 80 | }}} |
| | 81 | It is not clear why more than one ellipsis should be allowed, but this is the behavior of higher rank arrays that we |
| | 82 | are trying to preserve. |
| | 83 | |
| | 84 | === Refactoring === |
| | 85 | Currently all indexing on zero-rank arrays is implemented in a special if (nd == 0) branch of code that used to always |
| | 86 | raise an index error. This ensures that the changes do not affect any existing usage (except, the usage that relies on exceptions). |
| | 87 | On the other hand part of motivation for these changes was to make behavior of ndarrays more uniform and this should allow to |
| | 88 | eliminate if (nd == 0) checks alltogether. |
| | 89 | |