Modify _Set to support iteration.
Otherwise printlist(surprise) will fail with a TypeError, because map is called with an argument that doesn't support iteration.
This commit is contained in:
parent
910d7d46dc
commit
39f77bc90e
|
@ -416,6 +416,9 @@ class _Set:
|
|||
del data[x]
|
||||
return result
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self.data)
|
||||
|
||||
def tolist(self, sorted=1):
|
||||
"Return _Set elements as a list."
|
||||
data = self.data.keys()
|
||||
|
|
Loading…
Reference in New Issue