#348 PDL->null->slice('')->nelem results in error

critical
closed-fixed
nobody
None
5
2014-01-11
2014-01-10
Diab Jerius
No

This used to work in 2.6:

PDL->null->slice('')->nelem

(this strange code is the effective result of running squeeze on a null piddle)

It now returns an error:

slice: slice starts out of bounds in pos 0 (start is 0; source dim 0 runs 0--1)

According to the slice docs,

"", ":", or "X" -- keep
   The empty string, ":", or "X" cause the entire corresponding
   dimension to be kept unchanged.

So I think the new behavior is a bug. Certainly the old behavior was very useful.

I'm afraid my PP is a bit rusty today, else I'd suggest a fix. My apologies.

Discussion

  • Diab Jerius
    Diab Jerius
    2014-01-10

    AArgh. My further apologies. This is for PDL 2.007.

     
  • Craig DeForest
    Craig DeForest
    2014-01-11

    • status: open --> closed-fixed
     
  • Craig DeForest
    Craig DeForest
    2014-01-11

    fixed in git; also added tests to slice.t...