Commit 39f77bc9 authored by Jeremy Hylton's avatar Jeremy Hylton

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.
parent 910d7d46
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment