(self, *args)
return self.replace(**replacements)
Perform a shallow merge, where the last non-None write wins. This is
        intended to merge dataclasses that are a collection of optional values.
Perform a shallow merge, where the last non-None write wins. This is
        intended to merge dataclasses that are a collection of optional values.
Perform a shallow merge where the last non - None write wins . This is intended to merge dataclasses that are a collection of optional values .
def merged(self, *args):
        """Perform a shallow merge, where the last non-None write wins. This is
        intended to merge dataclasses that are a collection of optional values.
        """
        replacements = {}
        cls = type(self)
        for arg in args:
            for field in dataclasses.fields(cls):
                value = getattr(arg, field.name)
                if value is not None:
                    replacements[field.name] = value

        return self.replace(**replacements)
def merged ( self , * args ) : replacements = { } cls = type ( self ) for arg in args : for field in dataclasses . fields ( cls ) : value = getattr ( arg , field . name ) if value is not None : replacements [ field . name ] = value return self . replace ( * * replacements )