Skip to content

Simplify argument checking in Table.__getitem__. #12932

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

Merged
merged 1 commit into from
Dec 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions lib/matplotlib/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,8 @@ def __setitem__(self, position, cell):
self.stale = True

def __getitem__(self, position):
"""
Retrieve a custom cell from a given position.
"""
try:
row, col = position[0], position[1]
except Exception:
raise KeyError('Only tuples length 2 are accepted as coordinates')
return self._cells[row, col]
"""Retrieve a custom cell from a given position."""
return self._cells[position]

@property
def edges(self):
Expand Down