Whenever you pass a mutable object into a function, you should immediately make a copy of it if you're going to make any changes to the contents. That's true not just for __init__
but for any function. It's also true if the argument doesn't even have a default.
You should replace the line in ContextSummary
to:
self.db = db.copy()
I'm assuming that you didn't intend to modify the object you passed in. If the intent of the function is to modify its parameter, then it doesn't make sense for it to have a default does it?