-
-
Notifications
You must be signed in to change notification settings - Fork 411
Open
Description
When trying to evolve a frozen object at a deep level, there is a lot of boilerplate, e.g.,:
foo = attr.evolve(
foo,
bar=attr.evolve(
foo.bar,
baz=attr.evolve(
foo.bar.baz,
qux='whew!'
)
)
)Scala has a similar problem, being that immutable data classes is a normal thing in that language. There is a Scala library developed helped to solve that problem: https://www.optics.dev/Monocle/
Maybe it would be useful to have those sort of semantics for updating frozen attr objects,e.g.:
foo = attr.focus(foo, Foo.bar.baz.qux).modify('yay!')Any thoughts?
Metadata
Metadata
Assignees
Labels
No labels