def merge ( self , obj ) : for attribute in dir ( obj ) : if '__' in attribute : continue setattr ( self , attribute , getattr ( obj , attribute ) )
merge objects without overwrite python
This function merge another object s values with this instance
def merge(self, obj):
        """This function merge another object's values with this instance

        :param obj: An object to be merged with into this layer
        :type obj: object
        """
        for attribute in dir(obj):
            if '__' in attribute:
                continue
            setattr(self, attribute, getattr(obj, attribute))