{ } Raw JSON

bundles / traitlets latest / traitlets / traitlets / BaseDescriptor

class

traitlets.traitlets:BaseDescriptor

source: /traitlets/traitlets.py :437

Signature

class   BaseDescriptor ( )

Members

Summary

Base descriptor class

Notes

This implements Python's descriptor protocol.

This class is the base class for all such descriptors. The only magic we use is a custom metaclass for the main HasTraits class that does the following:

  • Sets the name attribute of every BaseDescriptor instance in the class dict to the name of the attribute.

  • Sets the this_class attribute of every BaseDescriptor instance in the class dict to the class that declared the trait. This is used by the This trait to allow subclasses to accept superclasses for This values.

Aliases

  • traitlets.BaseDescriptor