我有:
@attr.s
class Example:
number = attr.ib(validator=attr.validators.instance_of(int), init=False)
def __attrs_post_init__(self):
self.number = 'string'
print('It seems, validation was running before:(')
t = Example()
在这里如何正确设置验证?我想在实例化后验证 self.number 。