1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/types.py b/synapse/types.py
index 054b1e713c..b8e191bb3c 100644
--- a/synapse/types.py
+++ b/synapse/types.py
@@ -32,6 +32,12 @@ class DomainSpecificString(
HomeServer as being its own
"""
+ # Deny iteration because it will bite you if you try to create a singleton
+ # set by:
+ # users = set(user)
+ def __iter__(self):
+ raise ValueError("Attempted to iterate a %s" % (type(self).__name__))
+
@classmethod
def from_string(cls, s, hs):
"""Parse the string given by 's' into a structure object."""
|