@classmethod
def trait_subclasses(cls, all=False):
    """ Returns a list of the immediate (or all) subclasses of this class.

        Parameters
        ----------
        all : bool
            Indicates whether to return all subclasses of this class. If
            False, only immediate subclasses are returned.

        """
    if not all:
        return cls.__subclasses__()
    return cls._trait_subclasses([])
