Function dump
Synopsis
def dump(data, stream=None, Dumper=Dumper, **kwds)
Description
Serialize a Python object into a YAML stream. If stream is None, return the produced string instead.
Mentioned in
- Basic Tutorial / Getting Started
- Documentation / Installation
- Documentation / Dictionaries without nested collections are not dumped correctly
- Documentation / Python 3 support
- Documentation / Dumping YAML
- Documentation / Constructors, representers, resolvers
- Documentation / Names and modules
- Documentation / The yaml package
Source
Lines 285-291 in lib3/yaml/__init__.py.
def dump(data, stream=None, Dumper=Dumper, **kwds):
"""
Serialize a Python object into a YAML stream.
If stream is None, return the produced string instead.
"""
return dump_all([data], stream, Dumper=Dumper, **kwds)