atom.atom module

class atom.atom.Atom[source]

Bases: CAtom

The base class for defining atom objects.

Atom objects are special Python objects which never allocate an instance dictionary unless one is explicitly requested. The storage for an atom is instead computed from the Member objects declared on the class. Memory is reserved for these members with no over allocation.

This restriction make atom objects a bit less flexible than normal Python objects, but they are between 3x-10x more memory efficient than normal objects depending on the number of attributes.

classmethod members() Mapping[str, Member][source]

Get the members dictionary for the type.


result – The dictionary of members defined on the class. User code should not modify the contents of the dict.

Return type:

Mapping[str, Member]

suppress_notifications() Iterator[None][source]

Disable member notifications within in a context.


result – A context manager which disables atom notifications for the duration of the context. When the context exits, the state is restored to its previous value.

Return type: