def coerce(self, value, resource):
        """Coerce the value to an acceptable one.

        Only these kinds of values are returned as is:
        - str
        - int
        - float
        - True
        - False
        - None

        For all others values, it will be coerced using ``self.coerce_default`` (with convert the
        value to a string in the default implementation).

        Arguments
        ---------
        value : ?
            The value to be coerced.
        resource : dataql.resources.Resource
            The ``Resource`` object used to obtain this value from the original one.

        Returns
        -------
        str | int | float | True | False | None
            The coerced value.

        Example
        -------

        >>> from dataql.solvers.registry import Registry
        >>> registry = Registry()
        >>> from datetime import date
        >>> registry.register(date)
        >>> solver = AttributeSolver(registry)
        >>> solver.coerce('foo', None)
        'foo'
        >>> solver.coerce(11, None)
        11
        >>> solver.coerce(1.1, None)
        1.1
        >>> solver.coerce(True, None)
        True
        >>> solver.coerce(False, None)
        False
        >>> solver.coerce(date(2015, 6, 1), None)
        '2015-06-01'
        >>> solver.coerce(None, None)

        """
        if value in (True, False, None):
            return value
        if isinstance(value, (int, float)):
            return value
        if isinstance(value, str):
            return value
        return self.coerce_default(value, resource)
Coerce the value to an acceptable one.

        Only these kinds of values are returned as is:
        - str
        - int
        - float
        - True
        - False
        - None

        For all others values, it will be coerced using ``self.coerce_default`` (with convert the
        value to a string in the default implementation).

        Arguments
        ---------
        value : ?
            The value to be coerced.
        resource : dataql.resources.Resource
            The ``Resource`` object used to obtain this value from the original one.

        Returns
        -------
        str | int | float | True | False | None
            The coerced value.

        Example
        -------

        >>> from dataql.solvers.registry import Registry
        >>> registry = Registry()
        >>> from datetime import date
        >>> registry.register(date)
        >>> solver = AttributeSolver(registry)
        >>> solver.coerce('foo', None)
        'foo'
        >>> solver.coerce(11, None)
        11
        >>> solver.coerce(1.1, None)
        1.1
        >>> solver.coerce(True, None)
        True
        >>> solver.coerce(False, None)
        False
        >>> solver.coerce(date(2015, 6, 1), None)
        '2015-06-01'
        >>> solver.coerce(None, None)