.. versionadded:: 4.1
+ .. versionchanged:: 4.3
+ Added ``async for`` support in Python 3.5.
+
"""
def __init__(self, *args, **kwargs):
if args and kwargs:
# Now the semaphore has been released.
print("Worker %d is done" % worker_id)
+
+ .. versionchanged:: 4.3
+ Added ``async with`` support in Python 3.5.
"""
def __init__(self, value=1):
super(Semaphore, self).__init__()
... pass
...
... # Now the lock is released.
+
+ .. versionchanged:: 3.5
+ Added ``async with`` support in Python 3.5.
"""
def __init__(self):
self._block = BoundedSemaphore(value=1)
finally:
q.task_done()
+ .. versionchanged:: 4.3
+ Added ``async for`` support in Python 3.5.
+
"""
def __init__(self, maxsize=0):
if maxsize is None: