lenses/hooks/hook_funcs.py
def contains_remove(self, item):
    # type (Any, Any) -> Any
    '''Takes a collection and an item and returns a new collection
    of the same type with that item removed. The notion of "contains"
    is defined by the object itself; the following must be ``True``:

    .. code-block:: python

        item not in contains_remove(obj, item)

    This function is used by some lenses (particularly ContainsLens)
    to remove items from containers when necessary.

    The corresponding method call for this hook is
    ``obj._lens_contains_remove(item)``.

    There is no default implementation.
    '''
    try:
        self._lens_contains_remove
    except AttributeError:
        message = 'Don\'t know how to remove an item from {}'
        raise NotImplementedError(message.format(type(self)))
    else:
        return self._lens_contains_remove(item)
def contains_remove(self, item):
    # type (Any, Any) -> Any
    '''Takes a collection and an item and returns a new collection
    of the same type with that item removed. The notion of "contains"
    is defined by the object itself; the following must be ``True``:

    .. code-block:: python

        item not in contains_remove(obj, item)

    This function is used by some lenses (particularly ContainsLens)
    to remove items from containers when necessary.

    The corresponding method call for this hook is
    ``obj._lens_contains_remove(item)``.

    There is no default implementation.
    '''
    try:
        self._lens_contains_remove
    except AttributeError:
        message = 'Don\'t know how to remove an item from {}'
        raise NotImplementedError(message.format(type(self)))
    else:
        return self._lens_contains_remove(item)
Takes a collection and an item and returns a new collection
    of the same type with that item removed. The notion of "contains"
    is defined by the object itself; the following must be ``True``:

    .. code-block:: python

        item not in contains_remove(obj, item)

    This function is used by some lenses (particularly ContainsLens)
    to remove items from containers when necessary.

    The corresponding method call for this hook is
    ``obj._lens_contains_remove(item)``.

    There is no default implementation.