Skip to content

Commit 8513c27

Browse files
committed
Set
1 parent 399ff13 commit 8513c27

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ Set
123123
```
124124

125125
```python
126-
<set>.remove(<el>) # Raises KeyError.
126+
<el> = <set>.pop() # Raises KeyError if empty.
127+
<set>.remove(<el>) # Raises KeyError if missing.
127128
<set>.discard(<el>) # Doesn't raise an error.
128129
```
129130

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@
295295
&lt;bool&gt; = &lt;set&gt;.issubset(&lt;coll.&gt;) <span class="hljs-comment"># Or: &lt;set&gt; &lt;= &lt;set&gt;</span>
296296
&lt;bool&gt; = &lt;set&gt;.issuperset(&lt;coll.&gt;) <span class="hljs-comment"># Or: &lt;set&gt; &gt;= &lt;set&gt;</span>
297297
</code></pre>
298-
<pre><code class="python language-python hljs">&lt;set&gt;.remove(&lt;el&gt;) <span class="hljs-comment"># Raises KeyError.</span>
298+
<pre><code class="python language-python hljs">&lt;el&gt; = &lt;set&gt;.pop() <span class="hljs-comment"># Raises KeyError if empty.</span>
299+
&lt;set&gt;.remove(&lt;el&gt;) <span class="hljs-comment"># Raises KeyError if missing.</span>
299300
&lt;set&gt;.discard(&lt;el&gt;) <span class="hljs-comment"># Doesn't raise an error.</span>
300301
</code></pre>
301302
<div><h3 id="frozenset">Frozen Set</h3><ul>

0 commit comments

Comments
 (0)