Function safe_dump

Synopsis

def safe_dump(data, stream=None, **kwds)

Description

Serialize a Python object into a YAML stream. Produce only basic YAML tags. If stream is None, return the produced string instead.

Mentioned in

Source

Lines 300-307 in lib3/yaml/__init__.py.

def safe_dump(data, stream=None, **kwds):
    """
    Serialize a Python object into a YAML stream.
    Produce only basic YAML tags.
    If stream is None, return the produced string instead.
    """
    return dump_all([data], stream, Dumper=SafeDumper, **kwds)






Add Discussion as Guest

Log in