title: Modify attributes when initializing an object with dataclasses
body: <p>Hi I am new to Python.<br>
  I have worked with classes before, but not with Dataclasses.
  In regular classes I can set a attribute of my class by using other attributes.
  And also using functions to modifiy the attribute when initializing an object of my class.</p>
  
  <pre><code>class Person:
      def __init__(self, first_name, last_name):
          self.first_name = first_name
          self.last_name = self.to_upper(last_name)
          self.full_name = f"{self.first_name}_{self.last_name}"
  
      def to_upper(self, some_string):
          return some_string.upper()
  
  p1 = Person("john", "doe")
  print(p1.first_name)
  print(p1.last_name)
  print(p1.full_name)
  </code></pre>
  
  <p>I was expecting to do this also with dataclasses, as I see dataclasses to be the improved version of regular classes.</p>
  
  <pre><code>from dataclasses import dataclass, field
  
  @dataclass
  class Person:
      first_name: str
      last_name: str = field(default_factory=to_upper)
      full_name: str = field(default_factory=get_fullname)
  
      def to_upper(self, some_string):
          return some_string.upper()
  
      def get_fullname(self, first_name, last_name):
          return f"{first_name}_{last_name}"
  </code></pre>
  
  <p>What am I missing here?</p>
  
  <p>Docs for dataclasses <a href="https://docs.python.org/3/library/dataclasses.html" rel="nofollow noreferrer">https://docs.python.org/3/library/dataclasses.html</a></p>