Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise KeyError when attempting to slice Layout #1295

Merged
merged 3 commits into from
Apr 14, 2017
Merged

Conversation

philippjfr
Copy link
Member

Also snuck a unit test for annotations in here.

@@ -529,6 +529,9 @@ def __getitem__(self, key):
if key < len(self):
return self.data.values()[key]
raise KeyError("Element out of range.")
elif isinstance(key, slice):
raise KeyError("A Layout may not be sliced, ensure that you "
"are slicing on a leaf (i.e. not a branch) of the Layout.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe 'leaf node' or 'leaf item'?

@jlstevens
Copy link
Contributor

Looks good. Happy to merge when the tests pass. And I think that will be it for rc1!

@jlstevens
Copy link
Contributor

Merging.

@jlstevens jlstevens merged commit 1b94bfd into master Apr 14, 2017
@philippjfr philippjfr deleted the small_fixes branch April 19, 2017 21:39
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants