LockedDownTraits

class wwt_data_formats.LockedDownTraits(**kwargs)[source]

Bases: traitlets.HasTraits

A base class for HasTraits objects where we do not allow callers to add additional attributes to class instances. We do not allow them to delete attributes either.

The general motivation is that there are some kinds of classes that contain a pretty fixed set of fields where it’s much more likely that someone is going to make a typo in a variable assignment than it will be legitimately useful for them to add new attributes.

There’s an escape hatch, however, the rmeta attribute (for “runtime metadata”) is a namespace object to which one can attach whichever metadata one wants.

Attributes Summary

rmeta

A trait whose value must be an instance of a specified class.

Attributes Documentation

rmeta

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

Subclasses can declare default classes by overriding the klass attribute