Message395861
How about this example:
@dataclass
class Rect:
x: int
y: int
r=Rect(5,2)
@dataclass
class HyperRect(Rect):
z: int
def __post_init__(self):
self.vol = self.x*self.y*self.z
hr=HyperRect(5,2,3)
print("hr.vol", hr.vol)
Hyper Rectangle:
https://en.wikipedia.org/wiki/Hyperrectangle |
|
Date |
User |
Action |
Args |
2021-06-15 05:07:56 | andrei.avk | set | recipients:
+ andrei.avk, eric.smith, docs@python, MicaelJarniac |
2021-06-15 05:07:56 | andrei.avk | set | messageid: <1623733676.15.0.959920751451.issue44365@roundup.psfhosted.org> |
2021-06-15 05:07:56 | andrei.avk | link | issue44365 messages |
2021-06-15 05:07:56 | andrei.avk | create | |
|