Skip to content

Commit

Permalink
Add contains_key, an alias for has_key
Browse files Browse the repository at this point in the history
Fixes #25
  • Loading branch information
kislyuk committed Oct 31, 2019
1 parent 2c381ba commit b12125f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ensure/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ def has_key(self, key):
self.contains(key)
return KeyInspector(self._subject[key])

contains_key = has_key

def has_keys(self, keys):
"""
Ensures :attr:`subject` is a :class:`collections.Mapping` and contains *keys*, which must be an iterable.
Expand Down

0 comments on commit b12125f

Please sign in to comment.