@classmethod
def __coerce_from__(cls, value):
    """Cast a value which isn't an instance of the element type to
        the element type.  It's useful when a boxed element type could
        be more naturally represented using builtin type.

        For example, :class:`~libearth.feed.Mark` could be represented
        as a boolean value, and :class:`~libearth.feed.Text` also
        could be represented as a string.

        The following example shows how the element type can be
        automatically casted from string by implementing
        :meth:`__coerce_from__()` class method::

            @classmethod
            def __coerce_from__(cls, value):
                if isinstance(value, str):
                    return Text(value=value)
                raise TypeError('expected a string or Text')

        """
    raise TypeError(
        'expected an instance of {0.__module__}.{0.__name__}, not {1!r}'.
        format(cls, value))
