Pickling + unpickling the object is a neat trick to update objects to point to the new methods, but it's even more straightforward to just patch `obj.__class__ = reloaded_module.NewClass`. This is what ipython's autoreload extension used to do (and still does in some circumstances, along with other tricks to patch up old references), though nowadays it's had some improvements over this approach: https://github.com/ipython/ipython/pull/14500

Oh nice, thank you for that tip. I was doing the opposite, `new_obj = mod.Class(...)` and then assigning the dicts from the old object (which was when I realized the pickle save/load was easier).

Pytest has a number of tools for monkeypatching in tests; rpytest.monkeypatch.setattr, setitem: https://docs.pytest.org/en/stable/how-to/monkeypatch.html

Pickles aren't signed and pickle is basically eval().