summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-08-12 21:53:08 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-08-12 21:53:08 (GMT)
commit39f77bc90e16a6f3fffc7f770bc7bc6bd2c7a0a8 (patch)
treefd3f6e4d3a3c0cd1242d36adb2a2d839f28e935a /Lib
parent910d7d46dce571fa81428718e9be5307a56adeee (diff)
downloadcpython-39f77bc90e16a6f3fffc7f770bc7bc6bd2c7a0a8.zip
cpython-39f77bc90e16a6f3fffc7f770bc7bc6bd2c7a0a8.tar.gz
cpython-39f77bc90e16a6f3fffc7f770bc7bc6bd2c7a0a8.tar.bz2
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.
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/test/regrtest.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 285acba..4c7b4be 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -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()