Function load
Synopsis
def load(stream, Loader=None)
Description
Parse the first YAML document in a stream and produce the corresponding Python object.
Mentioned in
- Basic Tutorial / Getting Started
- Documentation / Installation
- Documentation / Dictionaries without nested collections are not dumped correctly
- Documentation / Loading YAML
- Documentation / Constructors, representers, resolvers
- Documentation / The yaml package
- Documentation / YAMLError
Source
Lines 103-117 in lib3/yaml/__init__.py.
def load(stream, Loader=None):
"""
Parse the first YAML document in a stream
and produce the corresponding Python object.
"""
if Loader is None:
load_warning('load')
Loader = FullLoader
loader = Loader(stream)
try:
return loader.get_single_data()
finally:
loader.dispose()