'Get state, adding a version number to it on its way out.'

def __getstate__(self, dict=None):

    dct = copy.copy((dict or self.__dict__))
    bases = _aybabtu(self.__class__)
    bases.reverse()
    bases.append(self.__class__)
    for base in bases:
        if ('persistenceForgets' in base.__dict__):
            for slot in base.persistenceForgets:
                if (slot in dct):
                    del dct[slot]
        if ('persistenceVersion' in base.__dict__):
            dct[('%s.persistenceVersion' % reflect.qual(base))] = base.persistenceVersion
    return dct
