(self, func)
return future
Return a new future with the result of the future passed through a
        function.

        Example::

            >>> import pykka
            >>> f = pykka.ThreadingFuture()
            >>> g = f.map(lambda x: x + 10)
            >>> f.set(30)
            >>> g.get()
            40

            >>> f = pykka.ThreadingFuture()
            >>> g = f.map(lambda x: x['foo'])
            >>> f.set({'foo': 'bar'}})
            >>> g.get()
            'bar'

        .. versionadded:: 1.2

        .. versionchanged:: 2.0
            Previously, if the future's result was an iterable (except a
            string), the function was applied to each item in the iterable.
            This behavior is unpredictable and makes regular use cases like
            extracting a single field from a dict difficult, thus the
            behavior has been simplified. Now, the entire result value is
            passed to the function.
Return a new future with the result of the future passed through a
        function.
Return a new future with the result of the future passed through a function .
def map(self, func):
        """
        Return a new future with the result of the future passed through a
        function.

        Example::

            >>> import pykka
            >>> f = pykka.ThreadingFuture()
            >>> g = f.map(lambda x: x + 10)
            >>> f.set(30)
            >>> g.get()
            40

            >>> f = pykka.ThreadingFuture()
            >>> g = f.map(lambda x: x['foo'])
            >>> f.set({'foo': 'bar'}})
            >>> g.get()
            'bar'

        .. versionadded:: 1.2

        .. versionchanged:: 2.0
            Previously, if the future's result was an iterable (except a
            string), the function was applied to each item in the iterable.
            This behavior is unpredictable and makes regular use cases like
            extracting a single field from a dict difficult, thus the
            behavior has been simplified. Now, the entire result value is
            passed to the function.
        """
        future = self.__class__()
        future.set_get_hook(lambda timeout: func(self.get(timeout)))
        return future
def map ( self , func ) : future = self . __class__ ( ) future . set_get_hook ( lambda timeout : func ( self . get ( timeout ) ) ) return future