Andrei Kulakov <[email protected]> added the comment:
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
----------
nosy: +andrei.avk
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue44365>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com