class documentation

class twisted.persisted.styles.Versioned: (source)

Known subclasses: twisted.web.distrib.ResourcePublisher, twisted.words.im.basesupport.AbstractAccount

View In Hierarchy

This type of object is persisted with versioning information.

I have a single class attribute, the int persistenceVersion. After I am unserialized (and styles.doUpgrade() is called), self.upgradeToVersionX() will be called for each version upgrade I must undergo.

For example, if I serialize an instance of a Foo(Versioned) at version 4 and then unserialize it when the code is at version 9, the calls:

  self.upgradeToVersion5()
  self.upgradeToVersion6()
  self.upgradeToVersion7()
  self.upgradeToVersion8()
  self.upgradeToVersion9()

will be made. If any of these methods are undefined, a warning message will be printed.

Class Variable persistenceVersion Undocumented
Class Variable persistenceForgets Undocumented
Method __setstate__ Undocumented
Instance Variable __dict__ Undocumented
Method __getstate__ Get state, adding a version number to it on its way out.
Method versionUpgrade (internal) Do a version upgrade.
persistenceVersion = (source)

Undocumented

(type: int)
persistenceForgets = (source)

Undocumented

(type: tuple)
def __setstate__(self, state): (source)

Undocumented

__dict__ = (source)

Undocumented

def __getstate__(self, dict=None): (source)

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

def versionUpgrade(self): (source)

(internal) Do a version upgrade.

API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.