issubset() and issuperset() to work with general iterables

This commit is contained in:
Raymond Hettinger 2003-11-21 07:56:36 +00:00
parent 82d73dd459
commit 3fbec701ca
2 changed files with 19 additions and 5 deletions

View file

@ -143,6 +143,10 @@ class TestJointOps(unittest.TestCase):
self.failIf(q <= r)
self.failIf(q > r)
self.failIf(q >= r)
self.assert_(set('a').issubset('abc'))
self.assert_(set('abc').issuperset('a'))
self.failIf(set('a').issubset('cbs'))
self.failIf(set('cbs').issuperset('a'))
def test_pickling(self):
p = pickle.dumps(self.s)