def with_constant_class(the_class):
  """
  Create a mixin class with ``constant_class`` attribute.

  Allows to set a constant class for constants container outside container itself.
  This may help to create more readable container definition, e.g.:

  .. code-block:: python

    from candv import Constants
    from candv import SimpleConstant
    from candv import with_constant_class


    class CustomConstant(SimpleConstant):
      ...

    class FOO(with_constant_class(CustomConstant), Constants):
      A = CustomConstant()
      B = CustomConstant()

  .. code-block:: python

    >>> FOO.constant_class
    <class '__main__.CustomConstant'>

  """
  class ConstantsMixin:
    constant_class = the_class

  return ConstantsMixin