Skip to content

Commit 919204b

Browse files
simplified some examples
1 parent c286611 commit 919204b

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ You can learn more about the book here:
2828
>
2929
> This is not some random third-party library, this is a class provided in the Python standard library (already installed on your system).
3030
>
31-
> This is the class you need to use to make your code run faster.
31+
> This is the class you need to make your code run faster.
3232
>
3333
> There's just one problem. No one knows about it (or how to use it well).
3434
>

‎src/lesson02_initializer.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ def task():
1111
sleep(1)
1212

1313
# initialize a worker in the thread pool
14-
def initialize_worker():
14+
def init():
1515
# report a message
1616
print('Initializing worker...')
1717

1818
# protect the entry point
1919
if __name__ == '__main__':
2020
# create and configure the thread pool
21-
with ThreadPool(2, initializer=initialize_worker) as pool:
21+
with ThreadPool(2, initializer=init) as pool:
2222
# issue tasks to the thread pool
2323
for _ in range(4):
2424
pool.apply_async(task)

‎src/lesson07_sequential_port_scanner.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SuperFastPython.com
2-
# scan a range of port numbers on host one by one,
2+
# scan a range of port numbers on host one by one
33
from socket import AF_INET
44
from socket import SOCK_STREAM
55
from socket import socket

0 commit comments

Comments
 (0)