black formatting

This commit is contained in:
Roland Thomas Jr 2024-05-12 22:42:11 -04:00
parent d528285828
commit 11f98d078f
Signed by: roland
GPG Key ID: 7C3C2B085A4C2872
5 changed files with 11 additions and 6 deletions

View File

@ -6,6 +6,7 @@ from concurrent.futures import ThreadPoolExecutor, Future
results: list[int] = []
def add_one(number: int) -> int:
sleep(randint(0, 2))
result = number + 1

View File

@ -5,6 +5,7 @@ from concurrent.futures import ThreadPoolExecutor, Future, wait, FIRST_COMPLETED
results: list[int] = []
def add_one(number: int) -> int:
sleep(randint(0, 2))
return number + 1

View File

@ -5,6 +5,7 @@ from concurrent.futures import ThreadPoolExecutor, wait, Future
results: list[int] = []
def add_one(number: int) -> int:
print(number)
sleep(randint(0, 2))
@ -28,7 +29,9 @@ def main() -> None:
print("All done!")
with ThreadPoolExecutor() as executor:
futures: list[Future] = [executor.submit(add_one, number) for number in range(10)]
futures: list[Future] = [
executor.submit(add_one, number) for number in range(10)
]
print("Done waiting!")
for future in futures:
print(future.result())