ReferenceSet methods
set.discard()
Removes an item if present, and does nothing if not.
Signature
collection.discard(item)Parameters
| Name | Means |
|---|---|
item | what to remove |
Returns
None.
Example
Python
tags = {"a", "b"}
tags.discard("a")
tags.discard("missing")
print(sorted(tags))Output
['b']