Skip to content
Snippets Groups Projects
Commit 6fafa878 authored by Paul "LeoNerd" Evans's avatar Paul "LeoNerd" Evans
Browse files

Deny __iter__ on UserID/RoomID/RoomName instances as it's a subtle bug that will bite you

parent bb793019
No related branches found
No related tags found
No related merge requests found
......@@ -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."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment