Open
Description
Here's the usecase:
def decrypt_secret(value):
return ...
@attrs.frozen
class Settings:
user: str
pwd: str = attrs.field(converter=decrypt_secret)
sett = Settings(user="name", pwd=<encrypted_value>)
sett.pwd # already decrypted value
attrs.evolve(sett, user="name2")
This will fail, because it tries to decrypt already decrypted value, although the field pwd
not changed at all.
Probably it is a wrong behaviour to convert/validate not changed fields.
Didn't find how to avoid converting/validating in this case.