def __init__ (self, default_value=None, klass=None, allow_none=True, **metadata ):
if default_value is None:<EOL><INDENT>if klass is None:<EOL><INDENT>klass = object<EOL><DEDENT><DEDENT>elif klass is None:<EOL><INDENT>klass = default_value<EOL><DEDENT>if not (inspect.isclass(klass) or isinstance(klass, str)):<EOL><INDENT>raise TraitError("<STR_LIT>")<EOL><DEDENT>self.klass       = klass<EOL>self._allow_none = allow_none<EOL>super(Type, self).__init__(default_value, **metadata)<EOL>
Construct a Type trait

        A Type trait specifies that its values must be subclasses of
        a particular class.

        If only ``default_value`` is given, it is used for the ``klass`` as
        well.

        Parameters
        ----------
        default_value : class, str or None
            The default value must be a subclass of klass.  If an str,
            the str must be a fully specified class name, like 'foo.bar.Bah'.
            The string is resolved into real class, when the parent
            :class:`HasTraits` class is instantiated.
        klass : class, str, None
            Values of this trait must be a subclass of klass.  The klass
            may be specified in a string like: 'foo.bar.MyClass'.
            The string is resolved into real class, when the parent
            :class:`HasTraits` class is instantiated.
        allow_none : boolean
            Indicates whether None is allowed as an assignable value. Even if
            ``False``, the default value may be ``None``.