![](https://secure.gravatar.com/avatar/86776c6c595af5117de5ba7b41bc33b5.jpg?s=120&d=mm&r=g)
Why isn't indices([42]) (or foo.setshape([42]), for that matter) allowed? Overzealous type checking, or a necessity of the C code? -- Magnus Lie Hetland http://hetland.org
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
Magnus Lie Hetland wrote:
Why isn't indices([42]) (or foo.setshape([42]), for that matter) allowed? Overzealous type checking, or a necessity of the C code?
Neither. It looks like a limitation of the indices function. Inserting "shape = tuple(shape)" into indices() removed the limitation. Thanks, Todd
![](https://secure.gravatar.com/avatar/86776c6c595af5117de5ba7b41bc33b5.jpg?s=120&d=mm&r=g)
Todd Miller <jmiller@stsci.edu>:
[snip]
Neither. It looks like a limitation of the indices function. Inserting "shape = tuple(shape)" into indices() removed the limitation.
Ah. But it's still impossible to use foo.setshape([bar]), then, I guess, even though it works with reshape()?
Thanks, Todd
-- Magnus Lie Hetland http://hetland.org
participants (2)
-
Magnus Lie Hetland
-
Todd Miller