title: Type hint for dataclass attribute which changes type in __post_init__
body: <p>Which type hint should I give to an attribute which changes type in the <code>__post_init__</code> method?</p>
  <p>In the below example the argument passed to the class instance is of type <code>int</code>. However, it gets converted to type <code>str</code>. What is the correct type hint to show?</p>
  <pre><code>from dataclasses import dataclass
  
  @dataclass
  class Base:
  
     apples: int   # Should the type hint be 'int' OR 'int | str'
     
     def __post_init__(self):
        self.apples = str(self.apples)   # Type changes from int to str
  
  
  b = Base(apples=1)   # Type is initially int
  </code></pre>
  <p>I am reusing the same attribute name here because I would like it show up in the <code>__repr__</code> of the dataclass.</p>