From f0d7e336f73a188405995b41aa30caaa78a01faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Tue, 10 Jul 2012 21:22:37 +0200 Subject: utils.multi_extract_dict: improve docstring. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaƫl Barrois --- factory/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'factory/utils.py') 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 -- cgit v1.2.3