When implementing getstate in coƶoerative inheritance, the typical thing to do is to call super to get dictionary and add the appropriate entries.  Setstate is similar: you extract what you need out of the dictionary and call super with the remaining entries.  Unfortunately, object does not have a default implementation, so you need a base class like so:

class DefaultSetstateAndGetstate:

    """
    Define default getstate and setstate for use in coƶperative inheritance.
    """
    def __getstate__(self):
        return self.__dict__.copy()

    def __setstate__(self, state):
        self.__dict__.update(state)


I suggest that this be added to object.

Best,

Neil