Skip to content

Commit 110332e

Browse files
committed
cleanup
1 parent 5ced0a9 commit 110332e

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

Doc/library/threading.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,22 @@ This module defines the following functions:
144144
of the result, even when terminated.
145145

146146

147-
.. function:: locked_iter(iterable)
147+
.. function:: iter_locked(iterable)
148148

149-
Make an iterator thread-safe.
149+
Make an iterable thread-safe.
150150

151151
Roughly equivalent to::
152152

153-
class locked_iter(Iterator):
153+
class iter_locked(Iterator):
154154
def __init__(self, it):
155155
self._it = iter(it)
156156
self._lock = Lock()
157157
def __next__(self):
158158
with self._lock:
159159
return next(self._it)
160160

161+
.. versionadded:: next
162+
161163
.. function:: main_thread()
162164

163165
Return the main :class:`Thread` object. In normal conditions, the

Lib/test/test_free_threading/test_threading_iter_locked.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def work(it):
4141

4242
data = tuple(range(400))
4343
for it in range(number_of_iterations):
44-
print(f'test_iter_locked {it=}')
4544
iter_locked_iterator = iter_locked(non_atomic_iterator(data,))
4645
worker_threads = []
4746
for ii in range(number_of_threads):

Lib/test/test_threading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2416,7 +2416,7 @@ def run_last():
24162416
self.assertIn("RuntimeError: can't register atexit after shutdown",
24172417
err.decode())
24182418

2419-
class LockedIterTests(unittest.TestCase):
2419+
class IterLockedTests(unittest.TestCase):
24202420

24212421
def test_iter_locked(self):
24222422
for s in ("123", [], [1, 2, 3], tuple(), (1, 2, 3)):

0 commit comments

Comments
 (0)