diff --git a/python/ray/util/actor_pool.py b/python/ray/util/actor_pool.py index cd87236e1..4aad576db 100644 --- a/python/ray/util/actor_pool.py +++ b/python/ray/util/actor_pool.py @@ -10,7 +10,8 @@ class ActorPool: Examples: >>> a1, a2 = Actor.remote(), Actor.remote() >>> pool = ActorPool([a1, a2]) - >>> print(pool.map(lambda a, v: a.double.remote(v), [1, 2, 3, 4])) + >>> print(list(pool.map(lambda a, v: a.double.remote(v),\ + ... [1, 2, 3, 4]))) [2, 4, 6, 8] """ @@ -52,7 +53,8 @@ class ActorPool: Examples: >>> pool = ActorPool(...) - >>> print(pool.map(lambda a, v: a.double.remote(v), [1, 2, 3, 4])) + >>> print(list(pool.map(lambda a, v: a.double.remote(v),\ + ... [1, 2, 3, 4]))) [2, 4, 6, 8] """ for v in values: @@ -79,7 +81,8 @@ class ActorPool: Examples: >>> pool = ActorPool(...) - >>> print(pool.map(lambda a, v: a.double.remote(v), [1, 2, 3, 4])) + >>> print(list(pool.map_unordered(lambda a, v: a.double.remote(v),\ + ... [1, 2, 3, 4]))) [6, 2, 4, 8] """ for v in values: