Commit 4012c5a9 authored by Philipp Arras's avatar Philipp Arras
Browse files

Add extract_by_keys

parent f737b474
......@@ -217,6 +217,11 @@ class MultiField(object):
return self
return MultiField.from_dict({key: self[key] for key in subset.keys()
if key in self})
def extract_by_keys(self, keys):
keys = set(self.domain.keys()) & set(keys)
return MultiField.from_dict({key: self[key] for key in keys})
def unite(self, other):
if self._domain is other._domain:
return self + other
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment