@ -2285,7 +2285,7 @@ with <lock>: # Enters the block by calling acq
```python
<Semaphore> = Semaphore(value=1) # Lock that can be acquired by 'value' threads.
<Event> = Event() # Method wait() blocks until set() is called.
<Barrier> = Barrier(n_times) # Wait() blocks until it's called n_times.
<Barrier> = Barrier(n_times) # Wait() blocks until it's called ntimes.
```
### Queue
@ -2710,7 +2710,7 @@ import numpy as np
<1/2d_arr> = <2d>[<2d/1d_bools>] # 1d_bools must have size of a column.
```
* **`':'` returns a slice of all dimension's indices. Omitted dimensions default to `':'`.**
* **Indices should not be tuples because Python converts `'obj[i, j]'` to `'obj[(i, j)]'`!**
* **Sixth line fails if tuple is used because Python converts `'obj[i, j]'` to `'obj[(i, j)]'`!**
* **Indexing with a slice and 1d array works the same as when using two slices (lines 4, 6, 7).**
* **`'ix_([1, 2], [3, 4])'` returns `'[[1], [2]]'` and `'[[3, 4]]'`. Due to broadcasting rules, this is the same as using `'[[1, 1], [2, 2]]'` and `'[[3, 4], [3, 4]]'`.**
* **Any value that is broadcastable to the indexed shape can be assigned to the selection.**
@ -3011,7 +3011,7 @@ while not pg.event.get(pg.QUIT):
### Rectangle
**Object for storing rectangular coordinates.**
```python
<Rect> = pg.Rect(x, y, width, height) # Floats get truncated into ints.
<Rect> = pg.Rect(x, y, width, height) # Returns a rectangle. Floats get truncated.
<div><h3id="semaphoreeventbarrier">Semaphore, Event, Barrier</h3><pre><codeclass="python language-python hljs"><Semaphore> = Semaphore(value=<spanclass="hljs-number">1</span>) <spanclass="hljs-comment"># Lock that can be acquired by 'value' threads.</span>
<Event> = Event() <spanclass="hljs-comment"># Method wait() blocks until set() is called.</span>
<Barrier> = Barrier(n_times) <spanclass="hljs-comment"># Wait() blocks until it's called n_times.</span>
<Barrier> = Barrier(n_times) <spanclass="hljs-comment"># Wait() blocks until it's called ntimes.</span>
</code></pre></div>
<div><h3id="queue">Queue</h3><pre><codeclass="python language-python hljs"><Queue> = queue.Queue(maxsize=<spanclass="hljs-number">0</span>) <spanclass="hljs-comment"># A thread-safe first-in-first-out queue.</span>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">':'</span></code> returns a slice of all dimension's indices. Omitted dimensions default to <codeclass="python hljs"><spanclass="hljs-string">':'</span></code>.</strong></li>
<li><strong>Indices should not be tuples because Python converts <codeclass="python hljs"><spanclass="hljs-string">'obj[i, j]'</span></code> to <codeclass="python hljs"><spanclass="hljs-string">'obj[(i, j)]'</span></code>!</strong></li>
<li><strong>Sixth line fails if tuple is used because Python converts <codeclass="python hljs"><spanclass="hljs-string">'obj[i, j]'</span></code> to <codeclass="python hljs"><spanclass="hljs-string">'obj[(i, j)]'</span></code>!</strong></li>
<li><strong>Indexing with a slice and 1d array works the same as when using two slices (lines 4, 6, 7).</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'ix_([1, 2], [3, 4])'</span></code> returns <codeclass="python hljs"><spanclass="hljs-string">'[[1], [2]]'</span></code> and <codeclass="python hljs"><spanclass="hljs-string">'[[3, 4]]'</span></code>. Due to broadcasting rules, this is the same as using <codeclass="python hljs"><spanclass="hljs-string">'[[1, 1], [2, 2]]'</span></code> and <codeclass="python hljs"><spanclass="hljs-string">'[[3, 4], [3, 4]]'</span></code>.</strong></li>
<li><strong>Any value that is broadcastable to the indexed shape can be assigned to the selection.</strong></li>
@ -2451,7 +2451,7 @@ rect = pg.Rect(<span class="hljs-number">240</span>, <span class="hljs-number">2
pg.display.flip()
</code></pre></div>
<div><h3id="rectangle">Rectangle</h3><p><strong>Object for storing rectangular coordinates.</strong></p><pre><codeclass="python language-python hljs"><Rect> = pg.Rect(x, y, width, height) <spanclass="hljs-comment"># Floats get truncated into ints.</span>
<div><h3id="rectangle">Rectangle</h3><p><strong>Object for storing rectangular coordinates.</strong></p><pre><codeclass="python language-python hljs"><Rect> = pg.Rect(x, y, width, height) <spanclass="hljs-comment"># Returns a rectangle. Floats get truncated.</span>