This function is a decorator that is used to add generated special methods to classes, as described below.
@dataclasses.dataclass(*, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False, weakref_slot=False)
@dataclass
class C:
...
@dataclass()
class C:
...
@dataclass(init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False,
match_args=True, kw_only=False, slots=False, weakref_slot=False)
class C:
...
@dataclass
class C:
a: int 'a' has no default value
b: int = 0 assign a default value for 'b'
def __init__(self, a: int, b: int = 0):