📅  最后修改于: 2022-03-11 14:46:51.207000             🧑  作者: Mango
from dataclasses import dataclass
@dataclass
class Point:
x: float
y: float
z: float = 0.0
p = Point(1.5, 2.5)
print(p) # Point(x=1.5, y=2.5, z=0.0)