python数据类


#数据类
from dataclasses import dataclass,field

@dataclass
class Team:
    name:str = field(compare=False)
    age:int


manu = Team('xuanxuan',8)
other_manu = Team('shui',13)

print(manu)
print(other_manu)
print(manu==other_manu)

你可能感兴趣的:(python,数学建模,开发语言)