Changing an attribute of a frozen class in attrs

Solution 1:

Changing the passed-in value is what a converter is for:

url = attr.ib(type=str, converter=lambda x: 'mango' if x=='apple' else x)