diff --git a/README.md b/README.md index a7bfed4..2c06fc2 100644 --- a/README.md +++ b/README.md @@ -2011,14 +2011,14 @@ from threading import Thread, RLock thread = Thread(target=<function>, args=(<first_arg>, )) thread.start() ... -<bool> = thread.is_alive() # Checks if thread has finished executing. -thread.join() # Waits for thread to finish. +<bool> = thread.is_alive() # Checks if thread has finished executing. +thread.join() # Waits for thread to finish. ``` ### Lock ```python lock = RLock() -lock.acquire() # Waits for lock to be available. +lock.acquire() # Waits for lock to be available. ... lock.release() ``` @@ -2040,8 +2040,8 @@ with ThreadPoolExecutor(max_workers=None) as executor: ``` ```python -<bool> = <Future>.done() # Checks if thread has finished executing. -<obj> = <Future>.result() # Waits for thread to finish and returns result. +<bool> = <Future>.done() # Checks if thread has finished executing. +<obj> = <Future>.result() # Waits for thread to finish and returns result. ``` ### Queue @@ -2052,10 +2052,10 @@ from queue import Queue ``` ```python -<Queue>.put(<el>) # Blocks until queue stops being full. -<Queue>.put_nowait(<el>) # Raises queue.Full exception if full. -<el> = <Queue>.get() # Blocks until queue stops being empty. -<el> = <Queue>.get_nowait() # Raises _queue.Empty exception if empty. +<Queue>.put(<el>) # Blocks until queue stops being full. +<Queue>.put_nowait(<el>) # Raises queue.Full exception if full. +<el> = <Queue>.get() # Blocks until queue stops being empty. +<el> = <Queue>.get_nowait() # Raises _queue.Empty exception if empty. ``` diff --git a/index.html b/index.html index 6b1fa5b..dc59afe 100644 --- a/index.html +++ b/index.html @@ -1771,12 +1771,12 @@ db = connector.connect(host=<str>, user=<str>, password=<str>, <div><h3 id="thread">Thread</h3><pre><code class="python language-python hljs">thread = Thread(target=<function>, args=(<first_arg>, )) thread.start() ... -<bool> = thread.is_alive() <span class="hljs-comment"># Checks if thread has finished executing.</span> -thread.join() <span class="hljs-comment"># Waits for thread to finish.</span> +<bool> = thread.is_alive() <span class="hljs-comment"># Checks if thread has finished executing.</span> +thread.join() <span class="hljs-comment"># Waits for thread to finish.</span> </code></pre></div> <div><h3 id="lock">Lock</h3><pre><code class="python language-python hljs">lock = RLock() -lock.acquire() <span class="hljs-comment"># Waits for lock to be available.</span> +lock.acquire() <span class="hljs-comment"># Waits for lock to be available.</span> ... lock.release() </code></pre></div> @@ -1793,18 +1793,18 @@ lock.release() <Future> = executor.submit(<function> [, <arg_1>, ...]) </code></pre></div> -<pre><code class="python language-python hljs"><bool> = <Future>.done() <span class="hljs-comment"># Checks if thread has finished executing.</span> -<obj> = <Future>.result() <span class="hljs-comment"># Waits for thread to finish and returns result.</span> +<pre><code class="python language-python hljs"><bool> = <Future>.done() <span class="hljs-comment"># Checks if thread has finished executing.</span> +<obj> = <Future>.result() <span class="hljs-comment"># Waits for thread to finish and returns result.</span> </code></pre> <div><h3 id="queue">Queue</h3><p><strong>A thread-safe FIFO queue. For LIFO queue use LifoQueue.</strong></p><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> queue <span class="hljs-keyword">import</span> Queue <Queue> = Queue(maxsize=<span class="hljs-number">0</span>) </code></pre></div> -<pre><code class="python language-python hljs"><Queue>.put(<el>) <span class="hljs-comment"># Blocks until queue stops being full.</span> -<Queue>.put_nowait(<el>) <span class="hljs-comment"># Raises queue.Full exception if full.</span> -<el> = <Queue>.get() <span class="hljs-comment"># Blocks until queue stops being empty.</span> -<el> = <Queue>.get_nowait() <span class="hljs-comment"># Raises _queue.Empty exception if empty.</span> +<pre><code class="python language-python hljs"><Queue>.put(<el>) <span class="hljs-comment"># Blocks until queue stops being full.</span> +<Queue>.put_nowait(<el>) <span class="hljs-comment"># Raises queue.Full exception if full.</span> +<el> = <Queue>.get() <span class="hljs-comment"># Blocks until queue stops being empty.</span> +<el> = <Queue>.get_nowait() <span class="hljs-comment"># Raises _queue.Empty exception if empty.</span> </code></pre> <div><h2 id="operator"><a href="#operator" name="operator">#</a>Operator</h2><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> operator <span class="hljs-keyword">import</span> add, sub, mul, truediv, floordiv, mod, pow, neg, abs <span class="hljs-keyword">from</span> operator <span class="hljs-keyword">import</span> eq, ne, lt, le, gt, ge