title: Python 3.7 dataclass: Raise error when assigning a value to undefined attribute
body: <p>I want to limit the usage of a dataclass to the users of my code and am wondering how can I raise an error in the following context:</p>
  
  <pre><code>from dataclasses import dataclass
  
  @dataclass
  class Foo:
      attr1: str
  
  foo = Foo("1")
  foo.attr2 = "3" #I want this line to raise an exception
  </code></pre>
  
  <p>Currently the last line succeeds and do not change the underlying object. I want the last line to throw an error.</p>