Function add_representer

Synopsis

def add_representer(data_type, representer, Dumper=Dumper)

Description

Add a representer for the given type. Representer is a function accepting a Dumper instance and an instance of the given data type and producing the corresponding representation node.

Mentioned in

Source

Lines 366-374 in lib3/yaml/__init__.py.

def add_representer(data_type, representer, Dumper=Dumper):
    """
    Add a representer for the given type.
    Representer is a function accepting a Dumper instance
    and an instance of the given data type
    and producing the corresponding representation node.
    """
    Dumper.add_representer(data_type, representer)






Add Discussion as Guest

Log in