atom.subclass module

class atom.subclass.ForwardSubclass(resolve)[source]

Bases: atom.subclass.Subclass

A Subclass which delays resolving the type definition.

The first time the value is accessed or modified, the type will be resolved and the forward subclass will behave identically to a normal subclass.

clone()[source]

Create a clone of the ForwardSubclass object.

default(owner)[source]

Called to retrieve the default value.

This is called the first time the default value is retrieved for the member. It resolves the type and updates the internal default handler to behave like a normal Subclass member.

resolve
validate(owner, old, new)[source]

Called to validate the value.

This is called the first time a value is validated for the member. It resolves the type and updates the internal validate handler to behave like a normal Subclass member.

class atom.subclass.Subclass(kind, default=None)[source]

Bases: atom.catom.Member

A value which allows objects subtypes of a given type.

Values will be tested using the PyObject_IsSubclass C API call. This call is equivalent to issubclass(value, kind) and all the same rules apply.

A Subclass member cannot be set to None.