(tag, object_constructor, Loader=None, constructor=Constructor)
Add an object constructor for the given tag.
    object_onstructor is a function that accepts a Loader instance
    and a node object and produces the corresponding Python object.
Add an object constructor for the given tag.
    object_onstructor is a function that accepts a Loader instance
    and a node object and produces the corresponding Python object.
Add an object constructor for the given tag . object_onstructor is a function that accepts a Loader instance and a node object and produces the corresponding Python object .
def add_constructor(tag, object_constructor, Loader=None, constructor=Constructor):
    # type: (Any, Any, Any, Any) -> None
    """
    Add an object constructor for the given tag.
    object_onstructor is a function that accepts a Loader instance
    and a node object and produces the corresponding Python object.
    """
    if Loader is None:
        constructor.add_constructor(tag, object_constructor)
    else:
        if hasattr(Loader, "add_constructor"):
            Loader.add_constructor(tag, object_constructor)
            return
        if issubclass(Loader, BaseLoader):
            BaseConstructor.add_constructor(tag, object_constructor)
        elif issubclass(Loader, SafeLoader):
            SafeConstructor.add_constructor(tag, object_constructor)
        elif issubclass(Loader, Loader):
            Constructor.add_constructor(tag, object_constructor)
        elif issubclass(Loader, RoundTripLoader):
            RoundTripConstructor.add_constructor(tag, object_constructor)
        else:
            raise NotImplementedError
def add_constructor ( tag , object_constructor , Loader = None , constructor = Constructor ) : # type: (Any, Any, Any, Any) -> None if Loader is None : constructor . add_constructor ( tag , object_constructor ) else : if hasattr ( Loader , "add_constructor" ) : Loader . add_constructor ( tag , object_constructor ) return if issubclass ( Loader , BaseLoader ) : BaseConstructor . add_constructor ( tag , object_constructor ) elif issubclass ( Loader , SafeLoader ) : SafeConstructor . add_constructor ( tag , object_constructor ) elif issubclass ( Loader , Loader ) : Constructor . add_constructor ( tag , object_constructor ) elif issubclass ( Loader , RoundTripLoader ) : RoundTripConstructor . add_constructor ( tag , object_constructor ) else : raise NotImplementedError