Skip to content

Commit d3aabee

Browse files
committed
Fix minor materials code style
1 parent 1c0f49b commit d3aabee

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ print(next(c)) # 111
318318

319319

320320
def print_name(prefix):
321-
print("Search for", prefix, "prefix")
321+
print("Search for ", prefix, " prefix")
322322
while True:
323323
name = yield
324324
if prefix in name:

materials/async_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
async def count(): # single event loop
55
print("One")
6-
yield asyncio.sleep(1) # when task reaches here it will sleep to 1 seconds ands says to do other job meantime
6+
await asyncio.sleep(1) # when task reaches here it will sleep for 1 second and says to do other job meantime
77
print("Two") # temporary gives control to another function
88

99

materials/decorator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
def coroutine(func):
2-
"""A decorator function that eliminates the need to call .next() when starting a coroutine."""
2+
"""
3+
A decorator function that eliminates the need to call .next()
4+
when starting a coroutine.
5+
"""
36
def start(*args, **kwargs):
47
cr = func(*args, **kwargs)
58
next(cr)

materials/send_coroutines.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
from typing import Coroutine
2+
3+
14
def coroutine():
25
while True:
3-
value = yield # allows to manipulate yielded value
6+
value = yield # allows manipulating yielded value
47
print(value)
58

69

@@ -50,7 +53,7 @@ def infinite_palindromes():
5053

5154

5255
def print_name(prefix):
53-
print("Search for", prefix, "prefix")
56+
print("Search for ", prefix, " prefix")
5457
while True:
5558
name = yield
5659
if prefix in name:

0 commit comments

Comments
 (0)