Glyph on Nostr: Here's a puzzle: Let's say we have a bunch of different kinds of object that exist in ...
Here's a puzzle:
Let's say we have a bunch of different kinds of object that exist in some long-lived context, like a server-side physics sim or a GUI. They have attributes. We *want* to model them as such, not stringly-typed config, because they're data structures with types & behavior.
How to implement generic change notifications without inheriting an implementation of __setattr__ or something morally equivalent?
This is the final frontier of composition-over-inheritance for me.
#python
Let's say we have a bunch of different kinds of object that exist in some long-lived context, like a server-side physics sim or a GUI. They have attributes. We *want* to model them as such, not stringly-typed config, because they're data structures with types & behavior.
How to implement generic change notifications without inheriting an implementation of __setattr__ or something morally equivalent?
This is the final frontier of composition-over-inheritance for me.
#python