why this question ?
I was trying to answer this question: Check if All Values Exist as Keys in Dictionary with something better than a generator com
The set.issubset algorithm requires a set to work with (frozensets and subclasses count); if you pass it something else, it will make a set. It's basically all(elem in other for elem in self)
, and it needs to know that elem in other
is efficient and means what it means for sets. The only way it knows how to guarantee that is to ensure other
is a set. Making a set is expensive.
(I've glossed over some details. If you want to know exactly what's going on, particularly if you have a weird set subclass, read the source code in the link.)