From: Jeremy Hylton Date: Sun, 12 Aug 2001 21:53:08 +0000 (+0000) Subject: Modify _Set to support iteration. X-Git-Tag: v2.2a3~613 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39f77bc90e16a6f3fffc7f770bc7bc6bd2c7a0a8;p=python 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. --- diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 285acba138..4c7b4bee39 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()