Ask Your Question

Revision history [back]

The documentation on sets explains it well:

If X is a list, tuple, Python set, or X.is_finite() is True, this returns a wrapper around Python’s enumerated immutable frozenset type with extra functionality. Otherwise it returns a more formal wrapper.

If you need the functionality of mutable sets, use Python’s builtin set type.

So Set([a,b]) acts more like Python's frozenset (hence it has no method to add an element).

If you want a mutable set, just use Python's set type.