# HG changeset patch # User Franz Glasner # Date 1522913024 -7200 # Node ID b7b0cea8ec6e45573ea33be2233714fa1a70b8bb # Parent 2f2e819e8d1795ac092e9e7a8eac41613ce3fc27 Document "configmix.yaml.loadXXX()" functions diff -r 2f2e819e8d17 -r b7b0cea8ec6e configmix/yaml.py --- a/configmix/yaml.py Thu Apr 05 09:12:29 2018 +0200 +++ b/configmix/yaml.py Thu Apr 05 09:23:44 2018 +0200 @@ -151,6 +151,10 @@ def load(stream, Loader=ConfigLoader): + """Parse the given `stream` and return a Python object constructed + from for the first document in the stream. + + """ data = yaml.load(stream, Loader) if OrderedDict: if not isinstance(data, OrderedDict): @@ -159,6 +163,10 @@ def load_all(stream, Loader=ConfigLoader): + """Parse the given `stream` and return a sequence of Python objects + corresponding to the documents in the `stream`. + + """ data_all = yaml.load_all(stream, Loader) if OrderedDict: for data in data_all: @@ -168,6 +176,13 @@ def safe_load(stream): + """Parse the given `stream` and return a Python object constructed + from for the first document in the stream. + + Recognize only standard YAML tags and cannot construct an + arbitrary Python object. + + """ data = yaml.load(stream, Loader=ConfigSafeLoader) if OrderedDict: if not isinstance(data, OrderedDict): @@ -176,6 +191,12 @@ def safe_load_all(stream): + """Return the list of all decoded YAML documents in the file `stream`. + + Recognize only standard YAML tags and cannot construct an + arbitrary Python object. + + """ data_all = yaml.load_all(stream, Loader=ConfigSafeLoader) if OrderedDict: for data in data_all: