diff --git a/fuzzymap/fuzzymap.py b/fuzzymap/fuzzymap.py index eded0c9..b903870 100644 --- a/fuzzymap/fuzzymap.py +++ b/fuzzymap/fuzzymap.py @@ -29,6 +29,11 @@ def closest_key(self, key): return matching return key + def get(self, key, default=None): + """Invokes the __getitem__ to keep the `FuzzyMap` behavior""" + + return self[key] or default + def __missing__(self, key): return super().get(self.closest_key(key))