MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __post_init__

Method __post_init__

geometry/geometry.py:69–75  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

67 next_side: Side | None = None
68
69 def __post_init__(self) -> None:
70 if not isinstance(self.length, (int, float)) or self.length <= 0:
71 raise TypeError("length must be a positive numeric value.")
72 if not isinstance(self.angle, Angle):
73 raise TypeError("angle must be an Angle object.")
74 if not isinstance(self.next_side, (Side, NoneType)):
75 raise TypeError("next_side must be a Side or None.")
76
77
78@dataclass

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected