* Simplify __post_init__ example usage. It applies to all base classes, not just dataclasses.
(cherry picked from commit
05008c27b73da640b63c0d335c65ade517c0eb84)
Co-authored-by: Steffen Zeile <48187781+Kaniee@users.noreply.github.com>
that has to be called, it is common to call this method in a
:meth:`__post_init__` method::
- @dataclass
class Rectangle:
- height: float
- width: float
+ def __init__(self, height, width):
+ self.height = height
+ self.width = width
@dataclass
class Square(Rectangle):