set.issuperset() Superset?
Last updated: 2026-09-22
set.issuperset() Superset?
set.issuperset(other) returns True if set contains every element of other.
| Category | Set Methods |
|---|---|
| Kind | Built-in Type Method |
| Python Version | all |
📝 Syntax
set.issuperset(other)
⚙️ Parameters
| other Required | The iterable to test against (the subset). |
|---|
Returns:bool, True if set contains every element of other.
Mutates the original:No (returns a new object)
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
True
False
💡 Related Cases
More case studies coming soon — check back later.
❓ FAQ
QWhat does issuperset() check?
AWhether the current set is a superset of other (contains every element of other).
QIs an empty set a superset?
AOnly the empty set is a superset of the empty set: set().issuperset(set()) is True, while set().issuperset({1}) is False.
QWhat is the difference from the >= operator?
AEssentially equivalent: a.issuperset(b) is like a >= b. For a proper superset use a > b.