Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-gomes authored Dec 14, 2023
1 parent dc5e3d7 commit 26acf62
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/netius/base/async_old.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@

class Future(object):
"""
Base future object that represents a promise that a certain
operation is going to be accomplished.
The base future object that represents a promise that a
certain operation is going to be accomplished.
Should be used as a placeholder for the callbacks for error
and success and the for the final result of the execution.
It should be used as a placeholder for the callbacks for error
and success and for the final result of the execution.
Most of the implementation takes inspiration on the reference
Python implementation on futures.
Most of the implementation takes inspiration from the
reference Python implementation on futures.
:see: https://en.wikipedia.org/wiki/Futures_and_promises
"""
Expand Down Expand Up @@ -244,14 +244,14 @@ def routine(*args, **kwargs):
is_future_ = is_future(result)
is_generator = inspect.isgenerator(result)

# in case the result is either a future or a generator the
# complete set of values are properly yield to the caller
# method as expected
# in case the result is either a future or a generator
# the complete set of values is properly yield
# to the caller method as expected
if is_future_ or is_generator:
for value in result: yield value

# otherwise the single resulting value is yield to the
# caller method (simple propagation)
# otherwise, the single resulting value is yield
# to the caller method (simple propagation)
else:
yield result

Expand Down Expand Up @@ -339,8 +339,8 @@ def coroutine_return(coroutine):
object to be the result of the future yield as the first element
of the generator.
This allows the possibility to provide compatibility with the legacy
not return allowed generators.
This allows the possibility of providing compatibility
with the legacy not return allowed generators.
:type coroutine: CoroutineObject
:param coroutine: The coroutine object that is going to be yield back
Expand Down

0 comments on commit 26acf62

Please sign in to comment.