title: how to use dataclass in Python for complex __init__?
body: <p>For instance, <code>self.env</code> has a complex implementation. How can I transfer it to use a dataclass?</p>
  
  <pre class="lang-py prettyprint-override"><code>class Request(object):
  
      def __init__(self, env: str, email: str, password: str):
          self.env = env if len(env) &gt; 2 else 'default'
          self.email = email
          self.password = password
  </code></pre>