jiffyclub / ipythonblocks

Practice Python with colored grids in the IPython Notebook
http://ipythonblocks.org
Other
157 stars 58 forks source link

2D slices fail with index -1 #7

Closed jiffyclub closed 11 years ago

jiffyclub commented 11 years ago

If either index of a 2D slice is -1 there are unexpected results. If the slice is a get there may be an error or a BlockGrid with zero dimension, if it is a set then nothing happens.

This is due to the behavior in BlockGrid._get_double_slice. If the index is -1 it will make a slice of -1:0, which results in nothing.