def distinct(self, selector=identity):
        '''Eliminate duplicate elements from a sequence.

        Note: This method uses deferred execution.

        Args:
            selector: An optional single argument function the result of which
                is the value compared for uniqueness against elements already
                consumed. If omitted, the element value itself is compared for
                uniqueness.

        Returns:
            Unique elements of the source sequence as determined by the
            selector function.  Note that it is unprojected elements that are
            returned, even if a selector was provided.

        Raises:
            ValueError: If the Queryable is closed.
            TypeError: If the selector is not callable.
        '''
        if self.closed():
            raise ValueError("Attempt to call distinct() on a "
                             "closed Queryable.")

        if not is_callable(selector):
            raise TypeError("distinct() parameter selector={0} is "
                "not callable".format(repr(selector)))

        return self._create(self._generate_distinct_result(selector))
Eliminate duplicate elements from a sequence.

        Note: This method uses deferred execution.

        Args:
            selector: An optional single argument function the result of which
                is the value compared for uniqueness against elements already
                consumed. If omitted, the element value itself is compared for
                uniqueness.

        Returns:
            Unique elements of the source sequence as determined by the
            selector function.  Note that it is unprojected elements that are
            returned, even if a selector was provided.

        Raises:
            ValueError: If the Queryable is closed.
            TypeError: If the selector is not callable.