public difference(other as HashSet<T>) as HashSet<T>:
Returns a new set containing elements from this set that are absent from other.
| Parameter | Description |
|---|---|
other | Elements to remove from the copy. |
A new hash set containing the difference.
import klyn.collections
remaining = {1, 2, 3}.difference({2})
assert remaining.size == 2
assert 2 not in remaining