The built-in set () was based on the old set.Set () sets and is faster.
Both do the same thing, although the sets module no longer exists in Python 3.
Here is the answer directly from the Python 2 library:
Types of built-in sets and phenisons have been developed based on lessons learned from the sets module. Key differences are:
Set and ImmutableSet have been renamed to set and frozenset.
- There is no equivalent to BaseSet. Use isinstance (x, (set, frozenset)) instead.
- The hash algorithm for built-in functions is much better (less collisions) for most datasets.
- Built-in versions have more space for brine.
- Embedded versions do not have union_update () method. Instead, use the update () method, which is equivalent.
- In embedded versions there is no _repr method (sorted = True). Instead, use the built-in repr () and sorted (): repr (sorted (s)) functions.
- The built-in version does not have a protocol for automatically converting to immutable. Many people find this feature confusing, and no one in the community has said that they found real opportunities for it.
source share