How to make ISet?

How do I go about making an ISet? I cannot for the life of me find where to import or access this data type correctly via Python.

Specifically, I want to experiment with the PropagateToViews method of the Grid class, and I need to pass a list of parallel views as an ISet. I’m using RPS as a REPL to make sure I know exactly what elements I’m working with, and none of the data types I’ve tried have worked, and I can’t find anywhere in the pyRevit source code that uses the ISet data type to use as a reference.

What am I missing here?

Probably this, but I can’t check, I am on my phone.

from System.Collections.Generic import HashSet

views = HashSet[DB.ElementId]()
views.Add(viewId)

I couldn’t get HashSet to import in RPS (I get ImportError: Cannot import name HashSet), but I can get SortedSet to work, so I’ll proceed with that.

Thanks Jean-Marc!

>>> from System.Collections.Generic import HashSet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: Cannot import name HashSet
>>> from System.Collections.Generic import SortedSet
>>> s = SortedSet[ElementId]()
>>> s.Add(doc.ActiveView.Id)
True
>>>  # Success!