title: Update dataclass fields from a dict in python
body: <p>How can I update the fields of a dataclass using a dict?</p>
  
  <p><strong>Example</strong>:</p>
  
  <pre><code>@dataclass
  class Sample:
      field1: str
      field2: str
      field3: str
      field4: str
  
  sample = Sample('field1_value1', 'field2_value1', 'field3_value1', 'field4_value1')
  updated_values = {'field1': 'field1_value2', 'field3': 'field3_value2'}
  </code></pre>
  
  <p>I want to do something like </p>
  
  <pre><code>sample.update(updated_values)
  </code></pre>