Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add slicing support for ellipsis and None #37
Looks great to me. One minor point: A check to see there isn't more than one
Edit: Ideally, the exception should be
On Sun, Dec 24, 2017 at 8:42 AM, Hameer Abbasi ***@***.***> wrote: ***@***.**** commented on this pull request. ------------------------------ In sparse/core.py <https://github.com/mrocklin/sparse/pull/37#discussion_r158605898>: > @@ -233,10 +233,19 @@ def __sizeof__(self): def __getitem__(self, index): if not isinstance(index, tuple): index = (index,) - index = tuple(ind + self.shape[i] if isinstance(ind, numbers.Integral) and ind < 0 else ind + if len(index) - index.count(None) > self.ndim: + raise IndexError("too many indices for array") + if index.count(Ellipsis) > 1: + raise IndexError("an index can only have a single sllipsis ('...')") There is a spelling error here. sllipsis should be Ellipsis. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/mrocklin/sparse/pull/37#pullrequestreview-85445245>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AASszMWNg0ryroKdK3h2tKt7HzJT9hiKks5tDn7agaJpZM4RLtHw> .