You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new resulting object will always have the default value.
I think I can live with that limitation if we document it and it's probably a good reason to resolve #207 with sticking assoc around with a better name?
Giving it further thought, the raison d'être for evolve are immutable objects…so I think it's fine to just document this edge case and leave it be?
The text was updated successfully, but these errors were encountered:
print("""
As pointed out in ericvsmith/dataclasses#42 (comment), attr.evolve() behaves in a specific way when an attribute has:
init=False,
a default/attrs_post_init, and
attribute(s) are modified on the instance.
The new resulting object will always have the default value for that attribute. This behavior is because evolve is primarily designed for immutable objects.
Given the nature of evolve and its purpose for immutable objects, it is acceptable to document this edge case and leave it as is.
""")
As pointed out in ericvsmith/dataclasses#42 (comment)
attr.evolve()
behaves rather weird if an attribute has__attrs_post_init__
, andThe new resulting object will always have the default value.
I think I can live with that limitation if we document it and it's probably a good reason to resolve #207 with sticking assoc around with a better name?
Giving it further thought, the raison d'être for evolve are immutable objects…so I think it's fine to just document this edge case and leave it be?
The text was updated successfully, but these errors were encountered: