title: What is the purpose of sort_index of a Dataclass in Python?
body: <p>I am learning about Dataclasses but I am confused on the purpose of sort_index and how it actually works.</p>
  <p>I can't seem to find any valuable information on it. The official Python documentation doesn't mention it, which is mind boggling.</p>
  <p>Here is an example:</p>
  <pre><code>@dataclass(order=True)
  class Person:
      sort_index: int = field(init=False, repr=False)
      name: str
      age: int
      weight: int = 190
   
      def __post_init__(self):
          self.sort_index = self.weight
  </code></pre>
  <p>So, what is the purpose of sort_index? What is it used for? When do I use it?</p>
  <p>Thanks again for taking the time to answer my question. I am new to Python.</p>