装饰器+描述符 实现给一个类添加属性且对添加的时,对属性进行类型审核: def zsq(**kwargs): def fun(obj): for i,j in kwargs.items(): setattr(obj,i,mxf(i,j)) return obj return fun class mxf(): def __init__(self,na,ty): self.na = na self.ty = ty def __get__(self, instance, owner): return…