# HG changeset patch # User Franz Glasner # Date 1640781191 -3600 # Node ID 25b61f0a1958ff97aa6753dc6c6e7b7834be4986 # Parent 33856ae1cc0beb498cdb6a775a6e3eef7cb336ce Docs for _split_ns() and _split_filters() diff -r 33856ae1cc0b -r 25b61f0a1958 configmix/config.py --- a/configmix/config.py Tue Dec 28 19:22:28 2021 +0100 +++ b/configmix/config.py Wed Dec 29 13:33:11 2021 +0100 @@ -345,16 +345,34 @@ return tuple() -def _split_ns(s): - ns, sep, rest = s.partition(_NS_SEPARATOR) +def _split_ns(varname): + """Split the variable name string `varname` into the namespace and + the namespace-specific name + + :type varname: str + :return: A tuple containing the namespace (or `None`) and the + namespace-specific (variable-)name + :rtype: tuple(str or None, str) + + """ + + ns, sep, rest = varname.partition(_NS_SEPARATOR) if sep: return (unquote(ns), rest) else: return (None, ns) -def _split_filters(s): - name, sep, filters = s.partition(_FILTER_SEPARATOR) +def _split_filters(varname): + """Split off the filter part from the `varname` string + + :type varname: str + :return: The tuple of the variable name without the filters and a list + of filters + :rtype: tuple(str, list) + + """ + name, sep, filters = varname.partition(_FILTER_SEPARATOR) if sep: filters = filters.strip() if filters: