from rich.pretty import pprintbut the
pprint(gc.garbage)blocks me 4ever
So you'd do something like
class Canary: pass
o = Canary()
request.state.foo = o
objgraph.find_backref_chain( random.choice(objgraph.by_type('Canary')), objgraph.is_proper_module), filename='chain.png')
gc.collect(), my memory goes back to what I'd expect it be - does this say something?
Thinking about separation of concerns, it feels wrong to add
__rich_console__ methods to my value objects. In architecting my application, I want to separate things into their components: the value objects that store the domain specific structures; separate serialization/deserialization mechanisms used in saving/loading from storage, and then the presentation layer for how things are presented. Right now I’m using attrs to define my value objects and then cattrs to do the serialization.
So, does anyone have a pattern that they use that would help with that? It feels like I would have to write a bunch of wrapper classes just for the projections that have the
__rich_console__ methods, which doesn’t feel great either.