summaryrefslogtreecommitdiff
path: root/factory
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2012-07-10 21:22:37 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2012-07-10 21:22:37 +0200
commitf0d7e336f73a188405995b41aa30caaa78a01faa (patch)
tree86ba92cca75afee7fca09f49089c90d9add82f71 /factory
parentefd66a93dd5234ac6d63f99c026029246a7b8bf3 (diff)
downloadfactory-boy-f0d7e336f73a188405995b41aa30caaa78a01faa.tar
factory-boy-f0d7e336f73a188405995b41aa30caaa78a01faa.tar.gz
utils.multi_extract_dict: improve docstring.
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Diffstat (limited to 'factory')
-rw-r--r--factory/utils.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/factory/utils.py b/factory/utils.py
index ce72a9a..c592da4 100644
--- a/factory/utils.py
+++ b/factory/utils.py
@@ -60,7 +60,13 @@ def extract_dict(prefix, kwargs, pop=True, exclude=()):
def multi_extract_dict(prefixes, kwargs, pop=True, exclude=()):
"""Extracts all values from a given list of prefixes.
- Arguments have the same meaning as for extract_dict.
+ Extraction will start with longer prefixes.
+
+ Args:
+ prefixes (str list): the prefixes to use for lookups
+ kwargs (dict): the dict from which values should be extracted
+ pop (bool): whether to use pop (True) or get (False)
+ exclude (iterable): list of prefixed keys that shouldn't be extracted
Returns:
dict(str => dict): a dict mapping each prefix to the dict of extracted