Skip to content

Commit

Permalink
Add default value to dict.pop() to remove unnecessary try/except.
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnbrown committed Nov 25, 2016
1 parent a92289e commit a4f9121
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions datatest/sources/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ def __init__(self, *sources, **kwd):
if not sources:
raise TypeError('expected 1 or more sources, got 0')

# Accept `missing` as a keyword-only argument.
try:
missing = kwd.pop('missing')
except KeyError:
missing = ''
missing = kwd.pop('missing', '') # Accept as keyword-only argument.

if kwd: # Enforce keyword-only argument
key, _ = kwd.popitem() # behavior that works in Python 2.x.
Expand Down

0 comments on commit a4f9121

Please sign in to comment.