Copy *self* and apply *changes*. This works similarly to `attr.evolve` but that function does not work with ``Attribute``. It is mainly meant to be used for `transform-fields`. .. versionadded:: 20.3.0
(self, **changes)
| 2735 | |
| 2736 | # Don't use attr.evolve since fields(Attribute) doesn't work |
| 2737 | def evolve(self, **changes): |
| 2738 | """ |
| 2739 | Copy *self* and apply *changes*. |
| 2740 | |
| 2741 | This works similarly to `attr.evolve` but that function does not work |
| 2742 | with ``Attribute``. |
| 2743 | |
| 2744 | It is mainly meant to be used for `transform-fields`. |
| 2745 | |
| 2746 | .. versionadded:: 20.3.0 |
| 2747 | """ |
| 2748 | new = copy.copy(self) |
| 2749 | |
| 2750 | new._setattrs(changes.items()) |
| 2751 | |
| 2752 | return new |
| 2753 | |
| 2754 | # Don't use _add_pickle since fields(Attribute) doesn't work |
| 2755 | def __getstate__(self): |
no test coverage detected