File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 123
123
```
124
124
125
125
``` python
126
- < set > .remove(< el> ) # Raises KeyError.
126
+ < el> = < set > .pop() # Raises KeyError if empty.
127
+ < set > .remove(< el> ) # Raises KeyError if missing.
127
128
< set > .discard(< el> ) # Doesn't raise an error.
128
129
```
129
130
Original file line number Diff line number Diff line change 295
295
<bool> = <set>.issubset(<coll.>) < span class ="hljs-comment "> # Or: <set> <= <set></ span >
296
296
<bool> = <set>.issuperset(<coll.>) < span class ="hljs-comment "> # Or: <set> >= <set></ span >
297
297
</ code > </ pre >
298
- < pre > < code class ="python language-python hljs "> <set>.remove(<el>) < span class ="hljs-comment "> # Raises KeyError.</ span >
298
+ < pre > < code class ="python language-python hljs "> <el> = <set>.pop() < span class ="hljs-comment "> # Raises KeyError if empty.</ span >
299
+ <set>.remove(<el>) < span class ="hljs-comment "> # Raises KeyError if missing.</ span >
299
300
<set>.discard(<el>) < span class ="hljs-comment "> # Doesn't raise an error.</ span >
300
301
</ code > </ pre >
301
302
< div > < h3 id ="frozenset "> Frozen Set</ h3 > < ul >
You can’t perform that action at this time.
0 commit comments